[build] upgrade eslint to 9.37.0 (#88)
Co-authored-by: tobi <tobi.smethurst@protonmail.com> Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88 Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org> Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { setupBrowserNotifications } from 'mastodon/actions/notifications';
|
||||
import Mastodon from 'mastodon/containers/mastodon';
|
||||
import { me } from 'mastodon/initial_state';
|
||||
import * as perf from 'mastodon/performance';
|
||||
import ready from 'mastodon/ready';
|
||||
import { store } from 'mastodon/store';
|
||||
import { setupBrowserNotifications } from "mastodon/actions/notifications";
|
||||
import Mastodon from "mastodon/containers/mastodon";
|
||||
import { me } from "mastodon/initial_state";
|
||||
import * as perf from "mastodon/performance";
|
||||
import ready from "mastodon/ready";
|
||||
import { store } from "mastodon/store";
|
||||
|
||||
/**
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
function main() {
|
||||
perf.start('main()');
|
||||
perf.start("main()");
|
||||
|
||||
return ready(async () => {
|
||||
const mountNode = document.getElementById('mastodon');
|
||||
const props = JSON.parse(mountNode.getAttribute('data-props'));
|
||||
const mountNode = document.getElementById("mastodon");
|
||||
const props = JSON.parse(mountNode.getAttribute("data-props"));
|
||||
|
||||
const root = createRoot(mountNode);
|
||||
root.render(<Mastodon {...props} />);
|
||||
store.dispatch(setupBrowserNotifications());
|
||||
|
||||
if (process.env.NODE_ENV === 'production' && me && 'serviceWorker' in navigator) {
|
||||
const { Workbox } = await import('workbox-window');
|
||||
const wb = new Workbox('/sw.js');
|
||||
if (process.env.NODE_ENV === "production" && me && "serviceWorker" in navigator) {
|
||||
const { Workbox } = await import("workbox-window");
|
||||
const wb = new Workbox("/sw.js");
|
||||
/** @type {ServiceWorkerRegistration} */
|
||||
let registration;
|
||||
|
||||
@@ -33,14 +33,14 @@ function main() {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
if (registration && 'Notification' in window && Notification.permission === 'granted') {
|
||||
const registerPushNotifications = await import('mastodon/actions/push_notifications');
|
||||
if (registration && "Notification" in window && Notification.permission === "granted") {
|
||||
const registerPushNotifications = await import("mastodon/actions/push_notifications");
|
||||
|
||||
store.dispatch(registerPushNotifications.register());
|
||||
}
|
||||
}
|
||||
|
||||
perf.stop('main()');
|
||||
perf.stop("main()");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user