Skip to content

Commit

Permalink
fix: 🐛 Les 'Toogles' sont activés par défaut (notifs) (#1440)
Browse files Browse the repository at this point in the history
* fix: 🐛 Les 'Toogles' sont activés par défaut (notifs)

✅ Closes: #1439

* fix: 🐛 Corrige un test en erreur

* refactor: 💡 PR  Les 'Toogles' sont activés par défaut (notifs)
  • Loading branch information
benguedj authored Sep 14, 2022
1 parent f63cc2d commit 7a56e7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions front/src/utils/notifications/notificationToggle.util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ describe("Notification Toggle Utils", () => {
);
});

it("should return false when key for type is undefined", async () => {
it("should return true when key for type is undefined (toogle default value)", async () => {
await NotificationToggleUtils.isToggleOn(NotificationType.epds).then(
(data) => {
expect(data).toEqual(false);
expect(data).toEqual(true);
}
);
});
Expand Down
2 changes: 1 addition & 1 deletion front/src/utils/notifications/notificationToggle.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getObjectValue } from "../storage.util";
export const isToggleOn = async (type: NotificationType): Promise<boolean> => {
const key = getStorageKey(type);
if (key) return (await getObjectValue(key)) as boolean;
return false;
return true; // 'On' par défaut
};

export const getStorageKey = (
Expand Down

0 comments on commit 7a56e7f

Please sign in to comment.