Skip to content

Commit

Permalink
1.0.53
Browse files Browse the repository at this point in the history
  • Loading branch information
Dwynr committed Aug 27, 2021
1 parent f573762 commit 3644b0c
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 75 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
29 changes: 16 additions & 13 deletions ios/App/App/capacitor.config.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io.filen.app",
"version": "1.0.52",
"version": "1.0.53",
"private": true,
"dependencies": {
"@capacitor/android": "^2.4.2",
Expand Down
117 changes: 63 additions & 54 deletions src/components/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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{
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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']
]
Expand All @@ -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']
Expand All @@ -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'],
Expand All @@ -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']
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 0 additions & 4 deletions src/components/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
8 changes: 8 additions & 0 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]){
Expand Down Expand Up @@ -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]){
Expand Down

0 comments on commit 3644b0c

Please sign in to comment.