Skip to content

Commit

Permalink
0.5.10
Browse files Browse the repository at this point in the history
Replace 'fs' with FileSystemAdapter
  • Loading branch information
alangrainger committed Oct 11, 2023
2 parents 9dc9f00 + 90c9155 commit bdfffe3
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "share-note",
"name": "Share Note",
"version": "0.5.9",
"version": "0.5.10",
"minAppVersion": "0.15.0",
"description": "Instantly share a note, with full styling. Data is shared encrypted by default and only you have the key.",
"author": "Alan Grainger",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "share-note",
"version": "0.5.9",
"version": "0.5.10",
"description": "Instantly share a note, with full styling. Data is stored encrypted on the server and only you have the key.",
"main": "main.js",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions src/note.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { CachedMetadata, moment, requestUrl, TFile, WorkspaceLeaf } from 'obsidian'
import { CachedMetadata, FileSystemAdapter, moment, requestUrl, TFile, WorkspaceLeaf } from 'obsidian'
import { encryptString, sha1 } from './crypto'
import SharePlugin from './main'
import * as fs from 'fs'
import StatusMessage, { StatusType } from './StatusMessage'
import NoteTemplate, { getElementStyle } from './NoteTemplate'
import { ThemeMode, TitleSource, YamlField } from './settings'
Expand Down Expand Up @@ -257,7 +256,7 @@ export default class Note {
const srcMatch = src.match(/app:\/\/\w+\/([^?#]+)/)
if (!srcMatch) continue
const localFile = window.decodeURIComponent(srcMatch[1])
const content = fs.readFileSync(localFile, null)
const content = await FileSystemAdapter.readLocalFile(localFile)
const filetype = localFile.split('.').pop()
if (filetype) {
const url = await this.plugin.api.uploadBinary({
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class ShareSettingsTab extends PluginSettingTab {
})

// Title source
const defaultTitleDesc = 'Select the location to source the published note title.'
const defaultTitleDesc = 'Select the location to source the published note title. It will default to the note title if nothing is found for the selected option.'
const titleSetting = new Setting(containerEl)
.setName('Note title source')
.setDesc(defaultTitleDesc)
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"0.5.6": "0.15.0",
"0.5.7": "0.15.0",
"0.5.8": "0.15.0",
"0.5.9": "0.15.0"
"0.5.9": "0.15.0",
"0.5.10": "0.15.0"
}

0 comments on commit bdfffe3

Please sign in to comment.