Skip to content

Commit

Permalink
Add new autoremember-timer-minutes setting (#316)
Browse files Browse the repository at this point in the history
  • Loading branch information
cxw42 committed Nov 11, 2023
1 parent df7bd04 commit 308c2b9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/common/setting-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,18 @@ _VAL[_NAM.CFGS_FAVICON_SOURCE] = (v)=>{
return (( v === FAVICON_SITE || v === FAVICON_CHROME || v === FAVICON_DDG ) ? v : undefined);
};

// #316. How often to autosave. Empty or <= 0 == don't autosave
_NAM.CFGS_AUTOREMEMBER_MINUTES = 'autoremember-timer-minutes';
_DEF[_NAM.CFGS_AUTOREMEMBER_MINUTES] = '';
_VAL[_NAM.CFGS_AUTOREMEMBER_MINUTES] = (v)=>{
const num = Number(v);
if(isNaN(num) || (Math.trunc(num) != num)) {
return undefined;
}
return num;
};


// }}}2

/// The default values for the configuration settings.
Expand Down
9 changes: 9 additions & 0 deletions app/settings/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,15 @@ setting_definitions.push(
"type": "checkbox",
"label": future_i18n('Prompt for confirmation before closing or deleting a tab that is currently playing audio (<i class="fa fa-music"></i>)'),
},
{
"tab": future_i18n("Behaviour"),
"group": future_i18n("Autosave"),
"name": S.S_AUTOREMEMBER_MINUTES,
"type": "text",
"label": future_i18n('If this is an integer <i>I</i> &gt;= 0, automatically '
+ 'remember all open windows/tabs every <i>I</i> minutes. Refresh the '
+ 'TabFern window to apply changes to this option.'),
},

// Appearance
{
Expand Down

0 comments on commit 308c2b9

Please sign in to comment.