Feature/improve restoring grid snapshots (#713)
* Update local storage functions * Update local storage hooks * Add session storage * Improve storing virtuoso grid snapshot * Use "useSyncExternalStore" for browser storage access * Get rid of location replacements in "AppbarSearch" Use session storage instead to prevent reloading the page all the time due to changing the location * Get rid of location replacements in "SourceMangas" Use session storage instead to prevent reloading the page all the time due to changing the location
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import * as storage from '@/util/localStorage.tsx';
|
||||
import { AppStorage } from '@/util/AppStorage.ts';
|
||||
|
||||
export abstract class BaseClient<Client, ClientConfig, Fetcher> {
|
||||
protected client!: Client;
|
||||
@@ -22,7 +22,7 @@ export abstract class BaseClient<Client, ClientConfig, Fetcher> {
|
||||
|
||||
// if port is 3000 it's probably running from webpack development server
|
||||
const inferredPort = port === '3000' ? '4567' : port;
|
||||
return storage.getItem('serverBaseURL', `${protocol}//${hostname}:${inferredPort}`);
|
||||
return AppStorage.local.getItemParsed('serverBaseURL', `${protocol}//${hostname}:${inferredPort}`);
|
||||
}
|
||||
|
||||
protected abstract createClient(): void;
|
||||
|
||||
Reference in New Issue
Block a user