Skip to content

Commit c776303

Browse files
committed
Merge branch 'master' into 195-mdata-matchers
2 parents 3cd4b66 + 17f6a04 commit c776303

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "custom-sort",
33
"name": "Custom File Explorer sorting",
4-
"version": "3.1.4",
4+
"version": "3.1.5",
55
"minAppVersion": "1.7.2",
66
"description": "Allows for manual and automatic, config-driven reordering and sorting of files and folders in File Explorer",
77
"author": "SebastianMC",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-custom-sort",
3-
"version": "3.1.4",
3+
"version": "3.1.5",
44
"description": "Custom Sort plugin for Obsidian (https://obsidian.md)",
55
"main": "main.js",
66
"scripts": {

src/settings.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface CustomSortPluginSettings {
1818

1919
const MILIS = 1000
2020
const DEFAULT_DELAY_SECONDS = 1
21-
const DELAY_MIN_SECONDS = 1
21+
const DELAY_MIN_SECONDS = 0
2222
const DELAY_MAX_SECONDS = 30
2323
const DEFAULT_DELAY = DEFAULT_DELAY_SECONDS * MILIS
2424

@@ -60,10 +60,14 @@ export class CustomSortSettingTab extends PluginSettingTab {
6060
containerEl.empty();
6161

6262
const delayDescr: DocumentFragment = sanitizeHTMLToDom(
63-
'Seconds to wait before applying custom ordering on plugin / app start.'
63+
'Number of seconds to wait before applying custom ordering on plugin / app start.'
6464
+ '<br>'
65-
+ 'For large vaults or on mobile the value might need to be increased if plugin constantly fails to auto-apply'
66-
+ ' custom ordering on start.'
65+
+ 'For large vaults, multi-plugin vaults or on mobile the value might need to be increased if you encounter issues with auto-applying'
66+
+ ' of custom ordering on start. The delay gives Obsidian additional time to sync notes from cloud storages, to populate notes metadata caches,'
67+
+ ' etc.'
68+
+ '<br>'
69+
+ 'At the same time if your vault is relatively small or only used on desktop, or not synced with other copies,'
70+
+ ' decreasing the delay to 0 could be a safe option.'
6771
+ '<br>'
6872
+ `Min: ${DELAY_MIN_SECONDS} sec., max. ${DELAY_MAX_SECONDS} sec.`
6973
)
@@ -74,9 +78,9 @@ export class CustomSortSettingTab extends PluginSettingTab {
7478
.addText(text => text
7579
.setValue(`${this.plugin.settings.delayForInitialApplication/MILIS}`)
7680
.onChange(async (value) => {
77-
let delayS = parseInt(value, 10)
78-
delayS = Number.isNaN(delayS) ? DEFAULT_DELAY_SECONDS : (delayS < DELAY_MIN_SECONDS ? DELAY_MIN_SECONDS :(delayS > DELAY_MAX_SECONDS ? DELAY_MAX_SECONDS : delayS))
79-
delayS = Math.round(delayS)
81+
let delayS = parseFloat(value)
82+
delayS = (Number.isNaN(delayS) || !Number.isFinite((delayS))) ? DEFAULT_DELAY_SECONDS : (delayS < DELAY_MIN_SECONDS ? DELAY_MIN_SECONDS :(delayS > DELAY_MAX_SECONDS ? DELAY_MAX_SECONDS : delayS))
83+
delayS = Math.round(delayS*10) / 10 // allow values like 0.2
8084
this.plugin.settings.delayForInitialApplication = delayS * MILIS
8185
await this.plugin.saveSettings()
8286
}))
@@ -110,7 +114,7 @@ export class CustomSortSettingTab extends PluginSettingTab {
110114
+ ' The `.md` filename suffix is optional.'
111115
+ '<br>'
112116
+ 'This will tell the plugin to read sorting specs and also folders metadata from these files.'
113-
+ '<br></br>'
117+
+ '<br>'
114118
+ 'The <i>Inside Folder, with Same Name Recommended</i> mode of Folder Notes is handled automatically, no additional configuration needed.'
115119
+ '</p>'
116120
+ '<p>NOTE: After updating this setting remember to refresh the custom sorting via clicking on the ribbon icon or via the <b>sort-on</b> command'

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@
5555
"3.1.1": "1.7.2",
5656
"3.1.2": "1.7.2",
5757
"3.1.3": "1.7.2",
58-
"3.1.4": "1.7.2"
58+
"3.1.4": "1.7.2",
59+
"3.1.5": "1.7.2"
5960
}

0 commit comments

Comments
 (0)