Default fetch-more mode to auto
This commit is contained in:
@@ -68,7 +68,7 @@ function FeedPage() {
|
|||||||
// loaded window by 50 episodes. manual mode: Enter on the row. auto mode:
|
// loaded window by 50 episodes. manual mode: Enter on the row. auto mode:
|
||||||
// reaching the bottom row fetches automatically (see the effect below).
|
// reaching the bottom row fetches automatically (see the effect below).
|
||||||
const app = useAppStore();
|
const app = useAppStore();
|
||||||
const fetchMoreMode = () => app.state().preferences.fetchMoreMode ?? "manual";
|
const fetchMoreMode = () => app.state().preferences.fetchMoreMode ?? "auto";
|
||||||
const showFetchMore = () => feedStore.hasMoreAcrossAll();
|
const showFetchMore = () => feedStore.hasMoreAcrossAll();
|
||||||
// Total navigable rows: episodes + the optional Fetch More row.
|
// Total navigable rows: episodes + the optional Fetch More row.
|
||||||
const rowCount = () => episodes().length + (showFetchMore() ? 1 : 0);
|
const rowCount = () => episodes().length + (showFetchMore() ? 1 : 0);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ export function MyShowsPage() {
|
|||||||
// counterpart to the Feed page's row (which loads every feed). manual
|
// counterpart to the Feed page's row (which loads every feed). manual
|
||||||
// mode: Enter on the row. auto mode: reaching the bottom row fetches
|
// mode: Enter on the row. auto mode: reaching the bottom row fetches
|
||||||
// automatically (see the effect below).
|
// automatically (see the effect below).
|
||||||
const fetchMoreMode = () => app.state().preferences.fetchMoreMode ?? "manual";
|
const fetchMoreMode = () => app.state().preferences.fetchMoreMode ?? "auto";
|
||||||
const showFetchMore = () =>
|
const showFetchMore = () =>
|
||||||
depth() >= 1 &&
|
depth() >= 1 &&
|
||||||
!!drilledShowId() &&
|
!!drilledShowId() &&
|
||||||
|
|||||||
@@ -211,10 +211,10 @@ export function usePreferencesItems(): SettingItem[] {
|
|||||||
kind: "select",
|
kind: "select",
|
||||||
display: () => (prefs().fetchMoreMode === "auto" ? "Auto" : "Manual"),
|
display: () => (prefs().fetchMoreMode === "auto" ? "Auto" : "Manual"),
|
||||||
help: () =>
|
help: () =>
|
||||||
`How the Feed and per-show episode lists load older episodes.\nManual: a "[Fetch More]" button at the bottom of the list.\nAuto: fetches automatically when reaching the bottom.\nType: select\nDefault: manual\nCurrent: ${prefs().fetchMoreMode === "auto" ? "Auto" : "Manual"}\nCycle with j/k; Enter to apply.`,
|
`How the Feed and per-show episode lists load older episodes.\nManual: a "[Fetch More]" button at the bottom of the list.\nAuto: fetches automatically when reaching the bottom.\nType: select\nDefault: auto\nCurrent: ${prefs().fetchMoreMode === "auto" ? "Auto" : "Manual"}\nCycle with j/k; Enter to apply.`,
|
||||||
cycle: (dir) => {
|
cycle: (dir) => {
|
||||||
const modes: Array<"manual" | "auto"> = ["manual", "auto"];
|
const modes: Array<"manual" | "auto"> = ["manual", "auto"];
|
||||||
const idx = modes.indexOf(prefs().fetchMoreMode ?? "manual");
|
const idx = modes.indexOf(prefs().fetchMoreMode ?? "auto");
|
||||||
const next = modes[(idx + dir + modes.length) % modes.length];
|
const next = modes[(idx + dir + modes.length) % modes.length];
|
||||||
app.updatePreferences({ fetchMoreMode: next });
|
app.updatePreferences({ fetchMoreMode: next });
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ const defaultPreferences: UserPreferences = {
|
|||||||
autoDownloadScope: "all",
|
autoDownloadScope: "all",
|
||||||
autoDownloadWhitelist: [],
|
autoDownloadWhitelist: [],
|
||||||
autoJumpToPlayer: true,
|
autoJumpToPlayer: true,
|
||||||
fetchMoreMode: "manual",
|
fetchMoreMode: "auto",
|
||||||
refreshIntervalMinutes: 30,
|
refreshIntervalMinutes: 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export type AppSettings = {
|
|||||||
visualizer: VisualizerSettings;
|
visualizer: VisualizerSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** How the Feed and per-show episode lists load older episodes (default: manual "[Fetch More]"). */
|
/** How the Feed and per-show episode lists load older episodes (default: auto). */
|
||||||
export type FetchMoreMode = "manual" | "auto";
|
export type FetchMoreMode = "manual" | "auto";
|
||||||
|
|
||||||
/** Which shows the auto-download setting applies to (default: all). */
|
/** Which shows the auto-download setting applies to (default: all). */
|
||||||
@@ -107,7 +107,7 @@ export type UserPreferences = {
|
|||||||
autoDownloadWhitelist: string[];
|
autoDownloadWhitelist: string[];
|
||||||
/** Jump to the Player view automatically when playback starts (default: true) */
|
/** Jump to the Player view automatically when playback starts (default: true) */
|
||||||
autoJumpToPlayer: boolean;
|
autoJumpToPlayer: boolean;
|
||||||
/** Load older episodes from the Feed list: manual button or automatic at the bottom (default: manual). */
|
/** Load older episodes from the Feed list: manual button or automatic at the bottom (default: auto). */
|
||||||
fetchMoreMode: FetchMoreMode;
|
fetchMoreMode: FetchMoreMode;
|
||||||
/** Minutes between automatic background feed refreshes (default: 30). */
|
/** Minutes between automatic background feed refreshes (default: 30). */
|
||||||
refreshIntervalMinutes: number;
|
refreshIntervalMinutes: number;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const defaultPreferences: UserPreferences = {
|
|||||||
autoDownloadScope: "all",
|
autoDownloadScope: "all",
|
||||||
autoDownloadWhitelist: [],
|
autoDownloadWhitelist: [],
|
||||||
autoJumpToPlayer: true,
|
autoJumpToPlayer: true,
|
||||||
fetchMoreMode: "manual",
|
fetchMoreMode: "auto",
|
||||||
refreshIntervalMinutes: 30,
|
refreshIntervalMinutes: 30,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user