This commit is contained in:
Satsuki Yanagi 2019-09-12 21:27:44 +09:00 committed by syuilo
parent c9e33f665e
commit c3f9b2dcc3
3 changed files with 9 additions and 9 deletions

View File

@ -509,7 +509,7 @@ export default Vue.extend({
saveBlockedHosts() {
this.$root.api('admin/update-meta', {
blockedHosts: this.blockedHosts.split('\n')
blockedHosts: this.blockedHosts ? this.blockedHosts.split('\n') : []
}).then(() => {
this.$root.dialog({
type: 'success',

View File

@ -461,7 +461,7 @@ export default Vue.extend({
iconUrl: this.iconUrl,
name: this.name,
description: this.description,
langs: this.languages.split(' '),
langs: this.languages ? this.languages.split(' ') : [],
cacheRemoteFiles: this.cacheRemoteFiles,
localDriveCapacityMb: parseInt(this.localDriveCapacityMb, 10),
remoteDriveCapacityMb: parseInt(this.remoteDriveCapacityMb, 10),
@ -490,8 +490,8 @@ export default Vue.extend({
enableServiceWorker: this.enableServiceWorker,
swPublicKey: this.swPublicKey,
swPrivateKey: this.swPrivateKey,
pinnedUsers: this.pinnedUsers.split('\n'),
hiddenTags: this.hiddenTags.split('\n'),
pinnedUsers: this.pinnedUsers ? this.pinnedUsers.split('\n') : [],
hiddenTags: this.hiddenTags ? this.hiddenTags.split('\n') : [],
useObjectStorage: this.useObjectStorage,
objectStorageBaseUrl: this.objectStorageBaseUrl ? this.objectStorageBaseUrl : null,
objectStorageBucket: this.objectStorageBucket ? this.objectStorageBucket : null,

View File

@ -430,15 +430,15 @@ export default define(meta, async (ps, me) => {
}
if (Array.isArray(ps.pinnedUsers)) {
set.pinnedUsers = ps.pinnedUsers;
set.pinnedUsers = ps.pinnedUsers.filter(Boolean);
}
if (Array.isArray(ps.hiddenTags)) {
set.hiddenTags = ps.hiddenTags;
set.hiddenTags = ps.hiddenTags.filter(Boolean);
}
if (Array.isArray(ps.blockedHosts)) {
set.blockedHosts = ps.blockedHosts;
set.blockedHosts = ps.blockedHosts.filter(Boolean);
}
if (ps.mascotImageUrl !== undefined) {
@ -501,8 +501,8 @@ export default define(meta, async (ps, me) => {
set.maintainerEmail = ps.maintainerEmail;
}
if (ps.langs !== undefined) {
set.langs = ps.langs;
if (Array.isArray(ps.langs)) {
set.langs = ps.langs.filter(Boolean);
}
if (ps.summalyProxy !== undefined) {