Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Add taskbar alignment to local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgunbal committed Oct 6, 2023
1 parent be9166b commit 6599faf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/reducers/taskbar.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { taskApps } from "../utils";

const alignment = localStorage.getItem("taskbar-align") || "center";

const defState = {
apps: taskApps,
prev: false,
prevApp: "",
prevPos: 0,
align: "center",
align: alignment,
search: true,
widgets: true,
audio: 3,
Expand All @@ -23,14 +25,17 @@ const taskReducer = (state = defState, action) => {
align: "center",
};
case "TASKLEF":
localStorage.setItem("taskbar-align", "left");
return {
...state,
align: "left",
};
case "TASKTOG":
const alignment = state.align == "left" ? "center" : "left";
localStorage.setItem("taskbar-align", alignment);
return {
...state,
align: state.align == "left" ? "center" : "left",
align: alignment,
};
case "TASKPSHOW":
return {
Expand Down

0 comments on commit 6599faf

Please sign in to comment.