]> Untitled Git - lemmy-ui.git/commitdiff
Making a pass at adding a service worker.
authorDessalines <tyhou13@gmx.com>
Thu, 10 Sep 2020 02:38:57 +0000 (21:38 -0500)
committerDessalines <tyhou13@gmx.com>
Thu, 10 Sep 2020 02:38:57 +0000 (21:38 -0500)
package.json
src/server/index.tsx
src/shared/components/user.tsx
src/shared/utils.ts
yarn.lock

index cf2dae85576ef3e9bcf5303a11ae01a4360bae41..62635dc2df063746b3fa1c8eb40932f74aafa81d 100644 (file)
@@ -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",
index 0553192112360292fca97f1f0c4c95f8ea1dbe8d..2545c96332801fa0795b9d8019000634ff0f66b8 100644 (file)
@@ -75,9 +75,12 @@ server.get('/*', async (req, res) => {
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
 
+           <!-- Web app manifest -->
+           <link rel="manifest" href="/assets/manifest.webmanifest">
+
            <!-- Icons -->
            <link rel="shortcut icon" type="image/svg+xml" href="/assets/favicon.svg" />
-           <!-- <link rel="apple-touch-icon" href="/assets/apple-touch-icon.png" /> -->
+           <link rel="apple-touch-icon" href="/assets/apple-touch-icon.png" />
 
            <!-- Styles -->
            <link rel="stylesheet" type="text/css" href="/static/styles/styles.css" />
index 84d9cd1fa1ad0d6cdc71c12af4ee2ad1f36ae769..db1586ddc2f5121c6cd3c0387555d7cfd312ed49 100644 (file)
@@ -556,6 +556,10 @@ export class User extends Component<any, UserState> {
                       this.state.userSettingsForm.default_listing_type
                     ]
                   }
+                  showLocal={
+                    this.state.siteRes.federated_instances &&
+                    this.state.siteRes.federated_instances.length > 0
+                  }
                   onChange={this.handleUserSettingsListingTypeChange}
                 />
               </form>
index 5214f07d55e4be50bc77706af768afdb8acadbe9..7f690950bc5970759cd5ad522726a9bad48a9841 100644 (file)
@@ -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]);
index 2e46b6ad545cd106dba725af4e09361ef109dde8..fd9a6c0bba6196434612d505030bbf5e823750a3 100644 (file)
--- 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"