This commit is contained in:
parent
91f0afdb89
commit
cf6b431d73
@ -63,6 +63,10 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
if (typeof ServiceWorkerGlobalScope !== "undefined" && self instanceof ServiceWorkerGlobalScope) {
|
||||||
|
// return if sw. we might want to use localForage (idb) to share keys between sw and app
|
||||||
|
return;
|
||||||
|
}
|
||||||
const existing = window.localStorage.getItem(AccountStoreKey);
|
const existing = window.localStorage.getItem(AccountStoreKey);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
const logins = JSON.parse(existing);
|
const logins = JSON.parse(existing);
|
||||||
@ -204,8 +208,8 @@ export class MultiAccountStore extends ExternalStore<LoginSession> {
|
|||||||
preferences: deepClone(DefaultPreferences),
|
preferences: deepClone(DefaultPreferences),
|
||||||
} as LoginSession;
|
} as LoginSession;
|
||||||
|
|
||||||
if ("nostr_os" in window && window.nostr_os) {
|
if ("nostr_os" in window && window?.nostr_os) {
|
||||||
window.nostr_os.saveKey(key.value);
|
window?.nostr_os.saveKey(key.value);
|
||||||
newSession.type = LoginSessionType.Nip7os;
|
newSession.type = LoginSessionType.Nip7os;
|
||||||
newSession.privateKeyData = undefined;
|
newSession.privateKeyData = undefined;
|
||||||
}
|
}
|
||||||
|
@ -334,9 +334,6 @@
|
|||||||
"defaultMessage": "Parent",
|
"defaultMessage": "Parent",
|
||||||
"description": "Link to parent note in thread"
|
"description": "Link to parent note in thread"
|
||||||
},
|
},
|
||||||
"AIgmDy": {
|
|
||||||
"defaultMessage": "Add up to 4 hashtags"
|
|
||||||
},
|
|
||||||
"ALdW69": {
|
"ALdW69": {
|
||||||
"defaultMessage": "Note by {name}"
|
"defaultMessage": "Note by {name}"
|
||||||
},
|
},
|
||||||
@ -1169,15 +1166,9 @@
|
|||||||
"d7d0/x": {
|
"d7d0/x": {
|
||||||
"defaultMessage": "LN Address"
|
"defaultMessage": "LN Address"
|
||||||
},
|
},
|
||||||
"d8gpCh": {
|
|
||||||
"defaultMessage": "Try to use less than 5 hashtags to stay on topic 🙏"
|
|
||||||
},
|
|
||||||
"dOQCL8": {
|
"dOQCL8": {
|
||||||
"defaultMessage": "Display name"
|
"defaultMessage": "Display name"
|
||||||
},
|
},
|
||||||
"ddd3JX": {
|
|
||||||
"defaultMessage": "Popular Hashtags"
|
|
||||||
},
|
|
||||||
"deEeEI": {
|
"deEeEI": {
|
||||||
"defaultMessage": "Register"
|
"defaultMessage": "Register"
|
||||||
},
|
},
|
||||||
|
@ -31,12 +31,20 @@ registerRoute(
|
|||||||
cacheName: "image-cache",
|
cacheName: "image-cache",
|
||||||
plugins: [
|
plugins: [
|
||||||
new ExpirationPlugin({
|
new ExpirationPlugin({
|
||||||
maxEntries: 100,
|
maxEntries: 200,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
registerRoute(
|
||||||
|
({ url }) => url.pathname.endsWith("api/v1/preview"),
|
||||||
|
new StaleWhileRevalidate({
|
||||||
|
cacheName: "preview-cache",
|
||||||
|
plugins: [new ExpirationPlugin({ maxAgeSeconds: 4 * 60 * 60 })],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
self.addEventListener("message", event => {
|
self.addEventListener("message", event => {
|
||||||
if (event.data && event.data.type === "SKIP_WAITING") {
|
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||||
self.skipWaiting();
|
self.skipWaiting();
|
||||||
|
@ -110,7 +110,6 @@
|
|||||||
"9wO4wJ": "Lightning Invoice",
|
"9wO4wJ": "Lightning Invoice",
|
||||||
"ABAQyo": "Chats",
|
"ABAQyo": "Chats",
|
||||||
"ADmfQT": "Parent",
|
"ADmfQT": "Parent",
|
||||||
"AIgmDy": "Add up to 4 hashtags",
|
|
||||||
"ALdW69": "Note by {name}",
|
"ALdW69": "Note by {name}",
|
||||||
"AN0Z7Q": "Muted Words",
|
"AN0Z7Q": "Muted Words",
|
||||||
"ASRK0S": "This author has been muted",
|
"ASRK0S": "This author has been muted",
|
||||||
@ -385,9 +384,7 @@
|
|||||||
"d+6YsV": "Lists to mute:",
|
"d+6YsV": "Lists to mute:",
|
||||||
"d2ebEu": "Not Subscribed to Push",
|
"d2ebEu": "Not Subscribed to Push",
|
||||||
"d7d0/x": "LN Address",
|
"d7d0/x": "LN Address",
|
||||||
"d8gpCh": "Try to use less than 5 hashtags to stay on topic 🙏",
|
|
||||||
"dOQCL8": "Display name",
|
"dOQCL8": "Display name",
|
||||||
"ddd3JX": "Popular Hashtags",
|
|
||||||
"deEeEI": "Register",
|
"deEeEI": "Register",
|
||||||
"djLctd": "Amount in sats",
|
"djLctd": "Amount in sats",
|
||||||
"djNL6D": "Read-only",
|
"djNL6D": "Read-only",
|
||||||
|
Loading…
Reference in New Issue
Block a user