diff --git a/deploy/saneUrl/index.js b/deploy/saneUrl/index.js index 72d0f9f9e2a8a13f98f96b7989c167ae61e2f47a..010f28e87db03d0f143fd78e961f3182d766af20 100644 --- a/deploy/saneUrl/index.js +++ b/deploy/saneUrl/index.js @@ -7,7 +7,12 @@ const RedisStore = require('rate-limit-redis') const { redisURL } = require('../lruStore') const { ProxyStore, NotExactlyPromiseAny } = require('./util') -const store = new Store() +let store +try { + store = new Store() +} catch (e) { + console.error(`Failed to new store.`, e) +} const depStore = new DepcStore() const proxyStore = new ProxyStore(store) diff --git a/deploy/saneUrl/util.js b/deploy/saneUrl/util.js index 949025cdc76bbf6b8794222bc67e2995ae1da482..12fce0a38ac846600110d638b1ea7a96cb6fd3cd 100644 --- a/deploy/saneUrl/util.js +++ b/deploy/saneUrl/util.js @@ -2,6 +2,7 @@ const { NotFoundError } = require('./store') class ProxyStore { static async StaticGet(store, req, name) { + if (!store) throw new Error(`store is falsy`) const payload = JSON.parse(await store.get(name)) const { expiry, value, ...rest } = payload if (expiry && (Date.now() > expiry)) { @@ -21,6 +22,7 @@ class ProxyStore { } async set(req, name, value) { + if (!this.store) throw new Error(`store is falsy`) const supplementary = req.user ? { userId: req.user.id, diff --git a/src/plugin/pluginBanner/pluginBanner.component.ts b/src/plugin/pluginBanner/pluginBanner.component.ts index 069be28e672895730be63fb7bdd41fb657c883e7..689f0aa32bfc4a7c16442bbc22e56c95d44a2b0d 100644 --- a/src/plugin/pluginBanner/pluginBanner.component.ts +++ b/src/plugin/pluginBanner/pluginBanner.component.ts @@ -53,10 +53,14 @@ export class PluginBannerUI { try { await this.pluginServices.addPluginViaManifestUrl(manifestUrl) this.loadingThirdpartyPlugin = false - this.matSnackbar.open(`Adding plugin successful`) + this.matSnackbar.open(`Adding plugin successful`, 'Dismiss', { + duration: 5000 + }) } catch (e) { this.loadingThirdpartyPlugin = false - this.matSnackbar.open(`Error adding plugin: ${e.toString()}`) + this.matSnackbar.open(`Error adding plugin: ${e.toString()}`, 'Dismiss', { + duration: 5000 + }) } } }