mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-10 09:18:33 +01:00
Don't fail when datatables state was not saved before
This should fix issue #241
This commit is contained in:
@@ -68,8 +68,10 @@ export default class extends Controller {
|
||||
stateLoadCallback(settings) {
|
||||
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
|
||||
data.start = 0;
|
||||
if (data) {
|
||||
//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;
|
||||
}
|
||||
@@ -201,4 +203,4 @@ export default class extends Controller {
|
||||
return this.element.dataset.select ?? false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user