service-worker: fixing path and scope

This commit is contained in:
Hunter Miller 2021-09-21 15:13:46 -05:00
parent ff024adfc7
commit 72ddbf1eb1
3 changed files with 9 additions and 20 deletions

View File

@ -26,6 +26,9 @@ if(urbitrc.URL) {
devServer = {
...devServer,
index: 'index.html',
// headers: {
// 'Service-Worker-Allowed': '/'
// },
proxy: [
{
context: (path) => {

View File

@ -1,7 +1,7 @@
if ('serviceWorker' in navigator && process.env.NODE_ENV !== 'development') {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/~landscape/js/bundle/serviceworker.js', {
scope: '/'
navigator.serviceWorker.register('/apps/landscape/serviceworker.js', {
scope: '/apps/landscape'
}).then((reg) => {
});
});

View File

@ -1,11 +1,9 @@
import { Box, Center, Col, LoadingSpinner, Text, Icon } from '@tlon/indigo-react';
import { Col } from '@tlon/indigo-react';
import {
IndexedNotification,
JoinRequests, Notifications,
JoinRequests,
Notifications,
seen,
Timebox,
unixToDa
} from '@urbit/api';
@ -13,10 +11,8 @@ import { BigInteger } from 'big-integer';
import _ from 'lodash';
import f from 'lodash/fp';
import moment from 'moment';
import React, { useEffect, useRef } from 'react';
import React, { useEffect } from 'react';
import { getNotificationKey } from '~/logic/lib/hark';
import { useLazyScroll } from '~/logic/lib/useLazyScroll';
import useLaunchState from '~/logic/state/launch';
import { daToUnix } from '~/logic/lib/util';
import useHarkState from '~/logic/state/hark';
import { Invites } from './invites';
@ -59,8 +55,6 @@ export default function Inbox(props: {
};
}, []);
const runtimeLag = useLaunchState(state => state.runtimeLag);
const ready = useHarkState(
s => Object.keys(s.unreads.graph).length > 0
);
@ -99,14 +93,6 @@ export default function Inbox(props: {
return (
<Col p={1} position="relative" height="100%" overflowY="auto" overflowX="hidden">
{runtimeLag && (
<Box bg="yellow" borderRadius={2} p={2} m={2}>
<Icon verticalAlign="middle" mr={2} icon="Tutorial" />
<Text verticalAlign="middle">
Update your binary to continue receiving updates.
</Text>
</Box>
)}
<Invites pendingJoin={props.pendingJoin} />
</Col>
);