Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,9 @@ class FileDisplayActivity :
)
}
} else {
fileDataStorageManager.addCreateFileOfflineOperation(filePaths, decryptedRemotePaths)
lifecycleScope.launch(Dispatchers.IO) {
fileDataStorageManager.addCreateFileOfflineOperation(filePaths, decryptedRemotePaths)
}
}
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import android.view.View
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.DialogFragment
import androidx.lifecycle.lifecycleScope
import com.google.android.material.button.MaterialButton
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.common.collect.Sets
Expand All @@ -40,6 +41,9 @@ import com.owncloud.android.ui.activity.FileDisplayActivity
import com.owncloud.android.utils.DisplayUtils
import com.owncloud.android.utils.KeyboardUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
import javax.inject.Inject

/**
Expand Down Expand Up @@ -198,13 +202,17 @@ class CreateFolderDialogFragment :
componentGetter?.fileOperationsHelper?.createFolder(path, encrypted)
} else {
Log_OC.d(TAG, "Network not available, creating offline operation")
fileDataStorageManager.addCreateFolderOfflineOperation(
path,
newFolderName,
parentFolder?.fileId
)

fda?.refreshCurrentDirectory()
lifecycleScope.launch(Dispatchers.IO) {
fileDataStorageManager.addCreateFolderOfflineOperation(
path,
newFolderName,
parentFolder?.fileId
)

withContext(Dispatchers.Main) {
fda?.refreshCurrentDirectory()
}
}
}
}
}
Expand Down
Loading