Skip to content

Commit

Permalink
Save nav history on swipe to the next date
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-ryzhkov authored Feb 15, 2025
1 parent 096d4c6 commit 81a0235
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions docs/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {detectGestures} from "./gesture.js";
import {autoindent, onDedent, onIndent} from "./indent.js";
import {updateLineFormOnSelChange} from "./line.js";
import {onMenuForm} from "./menu.js";
import {getNow, getTodayPlus, hideAtticForms, isDateTag, onBack, onMoveOverdue, onMoveToDate, onOpenDate, onOpenHome, onOpenTag, showOrHideOverdue} from "./nav.js";
import {getNow, getTodayPlus, hideAtticForms, isDateTag, onBack, onMoveOverdue, onMoveToDate, onOpenDate, onOpenHome, onOpenTag, openScreen, screenTypes, showOrHideOverdue} from "./nav.js";
import {addToRecentTags, onSearch} from "./search.js";
import {onDuplicate, onErase, onMoveDown, onMoveUp, onSelAll, onSelLine, onStrike, strikes} from "./sel.js";
import {debounce, hide, ib, o, on, onClick, toast, ui} from "./ui.js";
Expand Down Expand Up @@ -157,7 +157,7 @@ export const splitDoneText = (page) => {

/// openNextDate

const openNextDate = async (props) => {
const openNextDate = (props) => {
const {forward = true} = props ?? {};
const {tag} = mem.page;

Expand All @@ -166,17 +166,13 @@ const openNextDate = async (props) => {
return;
}

const date = new Date(
const nextTag = (new Date(
Date.parse(tag) +
(forward ? 1 : -1) *
1000*60*60*24
);
)).toISOString().split("T")[0];

await openPageByTag(
date
.toISOString()
.split("T")[0]
);
openScreen(screenTypes.page, {tag: nextTag});
};

/// openPage/ByTag
Expand Down

0 comments on commit 81a0235

Please sign in to comment.