From: Dessalines Date: Thu, 10 Sep 2020 02:38:57 +0000 (-0500) Subject: Making a pass at adding a service worker. X-Git-Url: http://these/git/%7B%60/feeds/front/static/%7BpictrsAvatarThumbnail%28?a=commitdiff_plain;h=e16ff7781a508063de775589f768bcc7b9131dce;p=lemmy-ui.git Making a pass at adding a service worker. --- diff --git a/package.json b/package.json index cf2dae8..62635dc 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "markdown-it-sup": "^1.0.0", "moment": "^2.24.0", "reconnecting-websocket": "^4.4.0", + "register-service-worker": "^1.7.1", "rxjs": "^6.6.3", "serialize-javascript": "^5.0.0", "tippy.js": "^6.1.1", diff --git a/src/server/index.tsx b/src/server/index.tsx index 0553192..2545c96 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -75,9 +75,12 @@ server.get('/*', async (req, res) => { + + + - + diff --git a/src/shared/components/user.tsx b/src/shared/components/user.tsx index 84d9cd1..db1586d 100644 --- a/src/shared/components/user.tsx +++ b/src/shared/components/user.tsx @@ -556,6 +556,10 @@ export class User extends Component { this.state.userSettingsForm.default_listing_type ] } + showLocal={ + this.state.siteRes.federated_instances && + this.state.siteRes.federated_instances.length > 0 + } onChange={this.handleUserSettingsListingTypeChange} /> diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 5214f07..7f69095 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -444,6 +444,9 @@ export function setTheme(theme: string = 'darkly', loggedIn: boolean = false) { // require('../assets/css/themes/_variables.darkly.scss'); // require('../assets/css/themes/_variables.darkly.scss'); // require('../assets/css/themes/_variables.darkly.scss'); + // require('../../node_modules/bootswatch/dist/darkly/bootstrap.min.css'); + // require('../../node_modules/bootswatch/dist/yeti/_variables.scss'); + // require('../../node_modules/bootstrap/scss/bootstrap.scss'); // unload all the other themes // for (var i = 0; i < themes.length; i++) { // let styleSheet = document.getElementById(themes[i]); diff --git a/yarn.lock b/yarn.lock index 2e46b6a..fd9a6c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8199,6 +8199,11 @@ regexpu-core@^4.7.0: unicode-match-property-ecmascript "^1.0.4" unicode-match-property-value-ecmascript "^1.2.0" +register-service-worker@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/register-service-worker/-/register-service-worker-1.7.1.tgz#6308347ac6c0af0f6c0b22ea5d59d25e836bc932" + integrity sha512-IdTfUZ4u8iJL8o1w8es8l6UMGPmkwHolUdT+UmM1UypC80IB4KbpuIlvwWVj8UDS7eJwkEYRcKRgfRX+oTmJsw== + registry-auth-token@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e"