mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Don't fail when datatables state was not saved before
This should fix issue #241
This commit is contained in:
parent
80389ff236
commit
4ecf99c17e
1 changed files with 5 additions and 3 deletions
|
@ -68,8 +68,10 @@ export default class extends Controller {
|
||||||
stateLoadCallback(settings) {
|
stateLoadCallback(settings) {
|
||||||
const data = JSON.parse( localStorage.getItem(this.getStateSaveKey()) );
|
const data = JSON.parse( localStorage.getItem(this.getStateSaveKey()) );
|
||||||
|
|
||||||
//Do not save the start value (current page), as we want to always start at the first page on a page reload
|
if (data) {
|
||||||
data.start = 0;
|
//Do not save the start value (current page), as we want to always start at the first page on a page reload
|
||||||
|
data.start = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -201,4 +203,4 @@ export default class extends Controller {
|
||||||
return this.element.dataset.select ?? false;
|
return this.element.dataset.select ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue