Skip to content

Commit

Permalink
fix: needless editor reload on content change (#158 close AlistGo/ali…
Browse files Browse the repository at this point in the history
…st#6098)

* fix: needless editor reload on content change

AlistGo/alist#6098

* minor fix
  • Loading branch information
flashlab authored Mar 11, 2024
1 parent 6f7056e commit 29ae724
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"dependencies": {
"@github/webauthn-json": "^2.1.1",
"@hope-ui/solid": "0.6.7",
"@monaco-editor/loader": "^1.3.2",
"@monaco-editor/loader": "^1.4.0",
"@motionone/solid": "^10.14.1",
"@solid-primitives/i18n": "^1.1.0",
"@solid-primitives/keyboard": "^1.2.5",
Expand Down
14 changes: 7 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/pages/home/previews/text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function Editor(props: { data?: string | ArrayBuffer; contentType?: string }) {
createEffect(
on(encoding, (v) => {
setValue(text(v))
console.log(value())
}),
)

Expand All @@ -49,7 +48,7 @@ function Editor(props: { data?: string | ArrayBuffer; contentType?: string }) {
<EncodingSelect encoding={encoding()} setEncoding={setEncoding} />
</Show>
<MonacoEditorLoader
value={value()}
value={text(encoding())}
theme={theme()}
path={objStore.obj.name}
onChange={(value) => {
Expand Down

0 comments on commit 29ae724

Please sign in to comment.