forked from abner/for-legacy-web
Run prettier on all files.
This commit is contained in:
@@ -1,26 +1,31 @@
|
||||
import { updateSW } from "../../main";
|
||||
import IconButton from "../ui/IconButton";
|
||||
import { ThemeContext } from "../../context/Theme";
|
||||
import { Download } from "@styled-icons/boxicons-regular";
|
||||
import { internalSubscribe } from "../../lib/eventEmitter";
|
||||
|
||||
import { useContext, useEffect, useState } from "preact/hooks";
|
||||
|
||||
import { internalSubscribe } from "../../lib/eventEmitter";
|
||||
|
||||
import { ThemeContext } from "../../context/Theme";
|
||||
|
||||
import IconButton from "../ui/IconButton";
|
||||
|
||||
import { updateSW } from "../../main";
|
||||
|
||||
var pendingUpdate = false;
|
||||
internalSubscribe('PWA', 'update', () => pendingUpdate = true);
|
||||
internalSubscribe("PWA", "update", () => (pendingUpdate = true));
|
||||
|
||||
export default function UpdateIndicator() {
|
||||
const [ pending, setPending ] = useState(pendingUpdate);
|
||||
const [pending, setPending] = useState(pendingUpdate);
|
||||
|
||||
useEffect(() => {
|
||||
return internalSubscribe('PWA', 'update', () => setPending(true));
|
||||
});
|
||||
useEffect(() => {
|
||||
return internalSubscribe("PWA", "update", () => setPending(true));
|
||||
});
|
||||
|
||||
if (!pending) return null;
|
||||
const theme = useContext(ThemeContext);
|
||||
if (!pending) return null;
|
||||
const theme = useContext(ThemeContext);
|
||||
|
||||
return (
|
||||
<IconButton onClick={() => updateSW(true)}>
|
||||
<Download size={22} color={theme.success} />
|
||||
</IconButton>
|
||||
)
|
||||
return (
|
||||
<IconButton onClick={() => updateSW(true)}>
|
||||
<Download size={22} color={theme.success} />
|
||||
</IconButton>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user