mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 16:05:44 +01:00
Implement context-based local storage
This allows re-rendering of useLocalStorage hooks whenever the value for the associated key changes. In the previous implementation, reading and writing via useLocalStorage did not cause a re-render and was therefore impossible.
This commit is contained in:
@@ -35,10 +35,8 @@ import { binder, extensionPoints } from "@scm-manager/ui-extensions";
|
||||
import ChangesetShortLink from "./repos/components/changesets/ChangesetShortLink";
|
||||
|
||||
import "./tokenExpired";
|
||||
import { ApiProvider } from "@scm-manager/ui-api";
|
||||
import { ShortcutDocsContextProvider } from "@scm-manager/ui-shortcuts";
|
||||
|
||||
// Makes sure that the global `define` function is registered and all provided modules are included in the final bundle at all times
|
||||
import { ApiProvider, LocalStorageProvider } from "@scm-manager/ui-api";
|
||||
import { ShortcutDocsContextProvider } from "@scm-manager/ui-shortcuts"; // Makes sure that the global `define` function is registered and all provided modules are included in the final bundle at all times
|
||||
import "./_modules/provided-modules";
|
||||
|
||||
binder.bind<extensionPoints.ChangesetDescriptionTokens>("changeset.description.tokens", ChangesetShortLink);
|
||||
@@ -51,13 +49,15 @@ if (!root) {
|
||||
ReactDOM.render(
|
||||
<ApiProvider>
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<ShortcutDocsContextProvider>
|
||||
<ActiveModalCountContextProvider>
|
||||
<Router basename={urls.contextPath}>
|
||||
<Index />
|
||||
</Router>
|
||||
</ActiveModalCountContextProvider>
|
||||
</ShortcutDocsContextProvider>
|
||||
<LocalStorageProvider>
|
||||
<ShortcutDocsContextProvider>
|
||||
<ActiveModalCountContextProvider>
|
||||
<Router basename={urls.contextPath}>
|
||||
<Index />
|
||||
</Router>
|
||||
</ActiveModalCountContextProvider>
|
||||
</ShortcutDocsContextProvider>
|
||||
</LocalStorageProvider>
|
||||
</I18nextProvider>
|
||||
</ApiProvider>,
|
||||
root
|
||||
|
||||
Reference in New Issue
Block a user