Skip to content
Snippets Groups Projects
Commit d820d4bd authored by Sebastian Mohr's avatar Sebastian Mohr
Browse files

New snips new get removed from the not seen list once they are placed

closes #100
parent 89619ff2
No related branches found
No related tags found
No related merge requests found
Pipeline #559667 failed
...@@ -33,6 +33,8 @@ the labels did not update correctly and were not removed correctly ...@@ -33,6 +33,8 @@ the labels did not update correctly and were not removed correctly
- Exit fullscreen button disappeared on desktop devices in fullscreen mode - Exit fullscreen button disappeared on desktop devices in fullscreen mode
- Formatting in password reset form was inconsistent with other forms - Formatting in password reset form was inconsistent with other forms
- Footer spacing would be set to zero if safe-area-inset-bottom was not available - Footer spacing would be set to zero if safe-area-inset-bottom was not available
- New snips notification not disappearing from the not seen list once they are placed see [#100](https://gitlab.gwdg.de/irp/snip/-/issues/100)
## [1.9.0] ## [1.9.0]
......
...@@ -171,7 +171,7 @@ function getSocketClient() { ...@@ -171,7 +171,7 @@ function getSocketClient() {
date: Date.now(), date: Date.now(),
}); });
const client = io(`ws://snip_socket:4001/api`, { const client = io(`ws://snip_socket:80/api`, {
reconnectionDelay: 1000, reconnectionDelay: 1000,
reconnection: true, reconnection: true,
reconnectionAttempts: 10, reconnectionAttempts: 10,
......
...@@ -7,7 +7,7 @@ interface Props { ...@@ -7,7 +7,7 @@ interface Props {
import { TbBrandGit, TbBug } from "react-icons/tb"; import { TbBrandGit, TbBug } from "react-icons/tb";
import { version } from "@package_json"; import Package from "@package_json";
export default function Footer({ className }: Props) { export default function Footer({ className }: Props) {
return ( return (
...@@ -16,7 +16,7 @@ export default function Footer({ className }: Props) { ...@@ -16,7 +16,7 @@ export default function Footer({ className }: Props) {
<ul> <ul>
<li> <li>
<a href="https://gitlab.gwdg.de/irp/snip/-/blob/main/CHANGELOG.md"> <a href="https://gitlab.gwdg.de/irp/snip/-/blob/main/CHANGELOG.md">
v{version} v{Package.version}
</a>{" "} </a>{" "}
© 2021 - {new Date().getFullYear().toString()} © 2021 - {new Date().getFullYear().toString()}
</li> </li>
......
...@@ -81,6 +81,9 @@ export function QueuedSnipsContextProvider({ ...@@ -81,6 +81,9 @@ export function QueuedSnipsContextProvider({
} }
return activeSnipId; return activeSnipId;
}); });
setNotSeenSnips((seenSnips) => {
return [...seenSnips.filter((id) => id !== snip_id)];
});
}, },
[setActiveSnipId], [setActiveSnipId],
); );
......
...@@ -7,7 +7,12 @@ export function usePersistentState<Type>( ...@@ -7,7 +7,12 @@ export function usePersistentState<Type>(
const prefixedKey = "snip-persistent-state-" + key; const prefixedKey = "snip-persistent-state-" + key;
// read key from local storage if not found use default value // read key from local storage if not found use default value
const [value, setValue] = useState<Type>(() => { const [value, setValue] = useState<Type>(() => {
const storedValue = localStorage.getItem(prefixedKey); let storedValue;
if (typeof window === "undefined") {
storedValue = null;
} else {
storedValue = localStorage.getItem(prefixedKey);
}
if (storedValue === null) { if (storedValue === null) {
if (typeof initialState === "function") { if (typeof initialState === "function") {
return (initialState as () => Type)(); return (initialState as () => Type)();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment