Add extra message to +error.svelte to handle, and clarify 'OFFLINE' error.
This commit is contained in:
@@ -11,18 +11,18 @@ const MAX_ENTRIES: number = RETURNED_LENGTH * 4;
|
||||
class QuickLinksService {
|
||||
#links = $state<QuickLink[]>([]);
|
||||
|
||||
constructor() {
|
||||
if (typeof window !== 'undefined') {
|
||||
const saved = localStorage.getItem('ql');
|
||||
if (saved) {
|
||||
try {
|
||||
this.#links = JSON.parse(saved);
|
||||
} catch {
|
||||
this.#links = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
constructor() {
|
||||
if (typeof window !== 'undefined') {
|
||||
const saved = localStorage.getItem('ql');
|
||||
if (saved) {
|
||||
try {
|
||||
this.#links = JSON.parse(saved);
|
||||
} catch {
|
||||
this.#links = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get list(): QuickLink[] {
|
||||
return this.#links.slice(0, RETURNED_LENGTH);
|
||||
@@ -58,16 +58,16 @@ constructor() {
|
||||
this.#links = sorted.slice(0, MAX_ENTRIES);
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.setItem('ql', JSON.stringify(this.#links));
|
||||
}
|
||||
localStorage.setItem('ql', JSON.stringify(this.#links));
|
||||
}
|
||||
}
|
||||
|
||||
reset() {
|
||||
this.#links = [];
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.removeItem('ql');
|
||||
}
|
||||
}
|
||||
this.#links = [];
|
||||
if (typeof window !== 'undefined') {
|
||||
localStorage.removeItem('ql');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const quickLinks = new QuickLinksService();
|
||||
|
||||
Reference in New Issue
Block a user