Add in client updater, Notices API

This commit is contained in:
Vendicated 2022-10-01 00:42:50 +02:00
parent 9aaa47ea4e
commit 8161a07dba
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3
20 changed files with 525 additions and 48 deletions

View file

@ -4,6 +4,7 @@ import { React } from "../webpack/common";
import { mergeDefaults } from '../utils/misc';
interface Settings {
notifyAboutUpdates: boolean;
unsafeRequire: boolean;
useQuickCss: boolean;
plugins: {
@ -15,10 +16,11 @@ interface Settings {
}
const DefaultSettings: Settings = {
notifyAboutUpdates: true,
unsafeRequire: false,
useQuickCss: true,
plugins: {}
} as any;
};
for (const plugin in plugins) {
DefaultSettings.plugins[plugin] = {
@ -77,7 +79,7 @@ export const Settings = makeProxy(settings);
* @returns Settings
*/
export function useSettings() {
const [, forceUpdate] = React.useReducer(x => ({}), {});
const [, forceUpdate] = React.useReducer(() => ({}), {});
React.useEffect(() => {
subscriptions.add(forceUpdate);