mirror of
https://github.com/muerwre/markdown-home-tab.git
synced 2025-04-25 00:46:41 +07:00
Compare commits
3 commits
3a4e8e7702
...
b5d12750cb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b5d12750cb | ||
![]() |
0de586249e | ||
![]() |
0ad22ec48a |
4 changed files with 13 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "markdown-home-tab",
|
||||
"private": true,
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "Markdown Home Tab",
|
||||
"short_name": "Markdown New Tab",
|
||||
"version": "0.0.6",
|
||||
"version": "0.0.7",
|
||||
"description": "Markdown right in your home tab! Paste links, pictures, lists and more. You can also customize colors to match your needs.",
|
||||
"manifest_version": 2,
|
||||
"permissions": ["storage"],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { useMemo } from "react";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { useStorage } from "~/modules/storage/StorageContext";
|
||||
import { useDefaultTheme } from "~/modules/theme/hooks/useDefaultTheme";
|
||||
import { defaultSettings } from "../context/SettingsContext";
|
||||
import { defaultSettings, SettingsValue } from "../context/SettingsContext";
|
||||
|
||||
export const useSettings = () => {
|
||||
const defaultColors = useDefaultTheme();
|
||||
|
@ -13,5 +13,12 @@ export const useSettings = () => {
|
|||
[defaultColors, storedSettings]
|
||||
);
|
||||
|
||||
return { settings, update: setSettings };
|
||||
const update = useCallback(
|
||||
(value: Partial<SettingsValue>) => {
|
||||
setSettings({ ...settings, ...value });
|
||||
},
|
||||
[setSettings, settings]
|
||||
);
|
||||
|
||||
return { settings, update };
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ import { useDelayedSync } from "./hooks/useDelayedSync";
|
|||
import { StorageContext } from "./StorageContext";
|
||||
import { SettingsValue } from "~/modules/settings/context/SettingsContext";
|
||||
|
||||
const debounceDelay = 500;
|
||||
const debounceDelay = 3000;
|
||||
|
||||
export const StorageProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [hydrated, setHydrated] = useState(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue