Skip to content

Commit 73f9b79

Browse files
fix (config): regression on config change
1 parent fe830fb commit 73f9b79

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

public/assets/model/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function get(key, defaultValue) {
2323
}
2424

2525
export function getVersion() {
26-
return get("version", "na");
26+
return get("version");
2727
}
2828

2929
export function query() {

public/assets/pages/filespage/ctrl_upload.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import { toHref } from "../../lib/skeleton/router.js";
33
import rxjs, { effect, onClick } from "../../lib/rx.js";
44
import { forwardURLParams } from "../../lib/path.js";
55
import { animate, slideYOut } from "../../lib/animate.js";
6-
import { loadCSS } from "../../helpers/loader.js";
76
import { qs, qsa } from "../../lib/dom.js";
87
import { AjaxError } from "../../lib/error.js";
98
import assert from "../../lib/assert.js";
9+
import { get as getConfig } from "../../model/config.js";
10+
import { loadCSS } from "../../helpers/loader.js";
1011
import { currentPath, isNativeFileUpload } from "./helper.js";
1112
import { getPermission, calculatePermission } from "./model_acl.js";
1213
import { mkdir, save } from "./model_virtual_layer.js";
@@ -358,7 +359,7 @@ function workerImplFile({ progress, speed }) {
358359
}
359360

360361
async prepareJob({ file, path, virtual }) {
361-
const chunkSize = (window.CONFIG["upload_chunk_size"] || 0) *1024*1024;
362+
const chunkSize = getConfig("upload_chunk_size", 0) *1024*1024;
362363
const numberOfChunks = Math.ceil(file.size / chunkSize);
363364
const headersNoCache = {
364365
"Cache-Control": "no-store",

public/assets/pages/filespage/thing.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/assets/pages/viewerpage/application_editor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createElement, onDestroy } from "../../lib/skeleton/index.js";
22
import rxjs, { effect } from "../../lib/rx.js";
33
import { animate, slideXIn, opacityOut } from "../../lib/animate.js";
44
import { qs } from "../../lib/dom.js";
5+
import { get as getConfig } from "../../model/config.js";
56
import { createLoader } from "../../components/loader.js";
67
import { createModal, MODAL_RIGHT_BUTTON } from "../../components/modal.js";
78
import { loadCSS, loadJS } from "../../helpers/loader.js";
@@ -65,7 +66,7 @@ export default async function(render, { acl$, getFilename, getDownloadUrl }) {
6566
}),
6667
);
6768
return rxjs.of(content).pipe(
68-
rxjs.mergeMap((content) => rxjs.of(window.CONFIG).pipe(
69+
rxjs.mergeMap((content) => rxjs.of(getConfig()).pipe(
6970
rxjs.mergeMap((config) => rxjs.from(loadKeybinding(config.editor)).pipe(rxjs.mapTo(config))),
7071
rxjs.map((config) => [content, config]),
7172
rxjs.mergeMap((arr) => rxjs.from(loadMode(extname(getFilename()))).pipe(

public/assets/pages/viewerpage/application_image.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ import { toHref } from "../../lib/skeleton/router.js";
33
import rxjs, { effect, onLoad, onClick } from "../../lib/rx.js";
44
import { animate } from "../../lib/animate.js";
55
import { extname } from "../../lib/path.js";
6-
import { loadCSS } from "../../helpers/loader.js";
76
import { qs } from "../../lib/dom.js";
7+
import { get as getConfig } from "../../model/config.js";
8+
import { Chromecast } from "../../model/chromecast.js";
9+
import { loadCSS } from "../../helpers/loader.js";
810
import { createLoader } from "../../components/loader.js";
911
import notification from "../../components/notification.js";
1012
import t from "../../locales/index.js";
1113
import ctrlError from "../ctrl_error.js";
12-
import { Chromecast } from "../../model/chromecast.js";
1314

1415
import { transition } from "./common.js";
1516

@@ -129,7 +130,7 @@ function buttonChromecast(filename, downloadURL) {
129130
const link = Chromecast.createLink("/" + toHref(downloadURL));
130131
const media = new window.chrome.cast.media.MediaInfo(
131132
link,
132-
window.CONFIG.mime[extname(filename)],
133+
getConfig("mime", {})[extname(filename)],
133134
);
134135
media.metadata = new window.chrome.cast.media.PhotoMediaMetadata();
135136
media.metadata.title = filename;

0 commit comments

Comments
 (0)