Skip to content

Commit

Permalink
migrate statefy get state usages
Browse files Browse the repository at this point in the history
  • Loading branch information
faaydemir committed Dec 4, 2023
1 parent 15acb05 commit ea89ac9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/view/page/home/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const editTask = (selectedTask) => {
export const deleteTask = async ({ task }) => {
taskProcessingStarted();
await task.delete();
const { startOfCalendar, calendarPeriod } = calendarState.state();
const { startOfCalendar, calendarPeriod } = calendarState.get();
await _loadCalendar({ startOfCalendar, calendarPeriod });
taskProcessingCompleted();
}
Expand All @@ -72,7 +72,7 @@ export const deleteTask = async ({ task }) => {
export const endTask = async ({ task }) => {
taskProcessingStarted();
await task.complete();
const { startOfCalendar, calendarPeriod } = calendarState.state();
const { startOfCalendar, calendarPeriod } = calendarState.get();
await _loadCalendar({ startOfCalendar, calendarPeriod });
taskProcessingCompleted();
}
Expand All @@ -96,7 +96,7 @@ export const saveTask = async ({ inputs, selectedTask }) => {
taskSavingCompleted(task);
}

const { startOfCalendar, calendarPeriod } = calendarState.state();
const { startOfCalendar, calendarPeriod } = calendarState.get();
_loadCalendar({ startOfCalendar, calendarPeriod });
}

Expand Down Expand Up @@ -128,12 +128,12 @@ export const logSubTaskProgress = async ({ log, subTask }) => {

async function _saveLog(log) {
logProgressed(log);
const { calendar } = calendarState.state();
const { calendar } = calendarState.get();
calendarModified(calendar);
try {
await log.save();
} catch (err) {
const { startOfCalendar, calendarPeriod } = calendarState.state();
const { startOfCalendar, calendarPeriod } = calendarState.get();
_loadCalendar({ startOfCalendar, calendarPeriod });
throw err;
}
Expand Down

0 comments on commit ea89ac9

Please sign in to comment.