From 3644b0c86102b790f3c73f7efee3c5a50b3659f5 Mon Sep 17 00:00:00 2001 From: Dwynr Date: Fri, 27 Aug 2021 18:44:46 +0200 Subject: [PATCH] 1.0.53 --- android/app/build.gradle | 4 +- ios/App/App/capacitor.config.json | 29 ++++---- package.json | 2 +- src/components/items.js | 117 ++++++++++++++++-------------- src/components/spawn.js | 2 +- src/components/user.js | 4 - src/utils/utils.js | 8 ++ 7 files changed, 91 insertions(+), 75 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index e24634315..b90683b3e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "io.filen.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 52 - versionName "1.0.52" + versionCode 53 + versionName "1.0.53" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/ios/App/App/capacitor.config.json b/ios/App/App/capacitor.config.json index b4f6c77e1..228d66eb0 100644 --- a/ios/App/App/capacitor.config.json +++ b/ios/App/App/capacitor.config.json @@ -1,15 +1,18 @@ { - "appId": "io.filen.app", - "appName": "Filen", - "bundledWebRuntime": false, - "npmClient": "npm", - "webDir": "build", - "plugins": { - "SplashScreen": { - "launchShowDuration": 15000, - "launchAutoHide": false, - "showSpinner": true - } - }, - "cordova": {} + "appId": "io.filen.app", + "appName": "Filen", + "bundledWebRuntime": false, + "npmClient": "npm", + "webDir": "build", + "plugins": { + "SplashScreen": { + "launchShowDuration": 15000, + "launchAutoHide": false, + "showSpinner": true + } + }, + "cordova": {}, + "server": { + "url": "http://192.168.178.20:8100" + } } diff --git a/package.json b/package.json index 356fdfd9e..edb7b401e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "io.filen.app", - "version": "1.0.52", + "version": "1.0.53", "private": true, "dependencies": { "@capacitor/android": "^2.4.2", diff --git a/src/components/items.js b/src/components/items.js index 5956ec00d..a73ee32fa 100644 --- a/src/components/items.js +++ b/src/components/items.js @@ -197,21 +197,6 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false return alert.present() } - items.push({ - type: "folder", - uuid: "default", - name: "Default", - date: language.get(this.state.lang, "defaultDrive"), - timestamp: (((+new Date()) / 1000) - (86400 * 3650)), - parent: "base", - receiverId: 0, - receiverEmail: "", - sharerId: 0, - sharerEmail: "", - color: null, - isBase: true - }) - for(let i = 0; i < res.data.folders.length; i++){ let folder = res.data.folders[i] @@ -231,31 +216,15 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false sharerEmail: "", color: folder.color || null, favorited: folder.favorited, - isBase: true + isBase: true, + isSync: folder.is_sync, + isDefault: folder.is_default } items.push(item) window.customVariables.cachedFolders[folder.uuid] = item } - - let iItems = [] - - iItems.push(items[0]) - - for(let i = 0; i < items.length; i++){ - if(items[i].name.toLowerCase() == "filen sync" && items[i].uuid !== "default"){ - iItems.push(items[i]) - } - } - - for(let i = 0; i < items.length; i++){ - if(items[i].name.toLowerCase() !== "filen sync" && items[i].uuid !== "default"){ - iItems.push(items[i]) - } - } - - items = iItems } else if(parent == "recent"){ try{ @@ -421,7 +390,9 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false receiverEmail: "", sharerId: folder.sharerId, sharerEmail: folder.sharerEmail, - color: folder.color || null + color: folder.color || null, + isSync: folder.is_sync, + isDefault: folder.is_default } items.push(item) @@ -532,7 +503,9 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false sharerId: 0, sharerEmail: "", color: folder.color || null, - favorited: folder.favorited + favorited: folder.favorited, + isSync: folder.is_sync, + isDefault: folder.is_default } items.push(item) @@ -639,7 +612,9 @@ export async function updateItemList(showLoader = true, bypassItemsCache = false sharerId: 0, sharerEmail: "", color: folder.color || null, - favorited: folder.favorited + favorited: folder.favorited, + isSync: folder.is_sync, + isDefault: folder.is_default } items.push(item) @@ -3426,13 +3401,23 @@ export async function spawnItemActionSheet(item){ ] } else if(window.location.href.indexOf("shared-out") !== -1){ - if(item.name.toLowerCase() == "filen sync"){ + if(item.isSync){ buttons = [ options['share'], options['publicLink'], options['color'], - //options['favorite'], - options['trash'], + options['favorite'], + options['stopSharing'], + options['cancel'] + ] + } + else if(item.isDefault){ + buttons = [ + options['share'], + options['publicLink'], + options['rename'], + options['color'], + options['favorite'], options['stopSharing'], options['cancel'] ] @@ -3441,10 +3426,8 @@ export async function spawnItemActionSheet(item){ buttons = [ options['share'], options['publicLink'], - //options['move'], options['rename'], options['color'], - //options['favorite'], options['trash'], options['stopSharing'], options['cancel'] @@ -3458,19 +3441,40 @@ export async function spawnItemActionSheet(item){ ] } else if(window.location.href.indexOf("links") !== -1){ - buttons = [ - options['share'], - options['publicLink'], - //options['move'], - options['rename'], - options['color'], - options['favorite'], - options['trash'], - options['cancel'] - ] + if(item.isSync){ + buttons = [ + options['share'], + options['publicLink'], + options['color'], + options['favorite'], + options['cancel'] + ] + } + else if(item.isDefault){ + buttons = [ + options['share'], + options['publicLink'], + options['rename'], + options['color'], + options['favorite'], + options['cancel'] + ] + } + else{ + buttons = [ + options['share'], + options['publicLink'], + //options['move'], + options['rename'], + options['color'], + options['favorite'], + options['trash'], + options['cancel'] + ] + } } else if(utils.currentParentFolder() == "base"){ - if(item.name.toLowerCase() == "filen sync"){ + if(item.isSync){ buttons = [ options['share'], options['publicLink'], @@ -3479,8 +3483,13 @@ export async function spawnItemActionSheet(item){ options['cancel'] ] } - else if(item.uuid == "default" || item.uuid == null){ + else if(item.isDefault){ buttons = [ + options['share'], + options['publicLink'], + options['rename'], + options['color'], + options['favorite'], options['cancel'] ] } diff --git a/src/components/spawn.js b/src/components/spawn.js index 5f8d00c3c..fda62d94e 100644 --- a/src/components/spawn.js +++ b/src/components/spawn.js @@ -150,7 +150,7 @@ export async function mainFabAction(){ buttons: [ { text: folderCreateBtnText, - icon: Ionicons.folderOpen, + icon: Ionicons.addCircle, handler: async () => { let alert = await alertController.create({ header: folderCreateNewFolderNameText, diff --git a/src/components/user.js b/src/components/user.js index 0caea22f6..1b2ac2584 100644 --- a/src/components/user.js +++ b/src/components/user.js @@ -286,10 +286,6 @@ export async function updateUserUsage(){ return false } - if(res.data.email !== this.state.userEmail){ - return window.customFunctions.logoutUser() - } - let storageUsedPercent = ((res.data.storage / res.data.max) * 100).toFixed(2) return this.setState({ diff --git a/src/utils/utils.js b/src/utils/utils.js index 37b7e9282..c291761fb 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -253,6 +253,10 @@ export function unixTimestamp(){ } export async function decryptFolderName(str, userMasterKeys, uuid = undefined){ + if(str == "default"){ + return "Default" + } + let cacheKey = "folder_" + uuid + "_" + str if(window.customVariables.cachedMetadata[cacheKey]){ @@ -298,6 +302,10 @@ export async function decryptFolderName(str, userMasterKeys, uuid = undefined){ } export async function decryptFolderNamePrivateKey(str, usrPrivKey, uuid = undefined){ + if(str == "default"){ + return "Default" + } + let cacheKey = "folder_" + uuid + "_" + str if(window.customVariables.cachedMetadata[cacheKey]){