check service work update on reload & init room

This commit is contained in:
2022-08-24 00:10:52 +08:00
parent 7b3eb9fbec
commit e1f3fafd58
7 changed files with 40 additions and 33 deletions

View File

@@ -5,6 +5,7 @@ import { Sidebar } from './Sidebar';
import { PressureHelper } from './PressureHelper';
import { TokenCtx } from './UserAction';
import { load_config, bgimg_style } from './Config';
import { check_service_work_update } from './Common';
import { load_attentions } from './Attention.js';
import { listen_darkmode } from './infrastructure/functions';
import { LoginPopup, TitleLine } from './infrastructure/widgets';
@@ -40,6 +41,7 @@ class App extends Component {
window.BACKEND =
localStorage['BACKEND'] || process.env.REACT_APP_BACKEND || '/';
check_service_work_update(false);
if (process.env.NODE_ENV === 'production') {
setTimeout(() => {
fetch('https://api.github.com/users/hole-thu')