Skip to content

Commit

Permalink
feat: updated quota when a file is added and copied
Browse files Browse the repository at this point in the history
  • Loading branch information
joragua committed Oct 18, 2024
1 parent 5b5c918 commit e16bc95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import com.owncloud.android.presentation.files.removefile.RemoveFilesDialogFragm
import com.owncloud.android.presentation.files.removefile.RemoveFilesDialogFragment.Companion.TAG_REMOVE_FILES_DIALOG_FRAGMENT
import com.owncloud.android.presentation.files.renamefile.RenameFileDialogFragment
import com.owncloud.android.presentation.files.renamefile.RenameFileDialogFragment.Companion.FRAGMENT_TAG_RENAME_FILE
import com.owncloud.android.presentation.spaces.SpacesListViewModel
import com.owncloud.android.presentation.thumbnails.ThumbnailsRequester
import com.owncloud.android.presentation.transfers.TransfersViewModel
import com.owncloud.android.ui.activity.FileActivity
Expand Down Expand Up @@ -145,6 +146,7 @@ class MainFileListFragment : Fragment(),
}
private val fileOperationsViewModel by sharedViewModel<FileOperationsViewModel>()
private val transfersViewModel by viewModel<TransfersViewModel>()
private val spacesListViewModel: SpacesListViewModel by viewModel { parametersOf(AccountUtils.getCurrentOwnCloudAccount(requireContext()).name, false) }

private var _binding: MainFileListFragmentBinding? = null
private val binding get() = _binding!!
Expand Down Expand Up @@ -634,6 +636,10 @@ class MainFileListFragment : Fragment(),
fileOperationsViewModel.refreshFolderLiveData.observe(viewLifecycleOwner) {
binding.syncProgressBar.isIndeterminate = it.peekContent().isLoading
binding.swipeRefreshMainFileList.isRefreshing = it.peekContent().isLoading

// Refresh the spaces and update the quota
spacesListViewModel.refreshSpacesFromServer()

hideRefreshFab()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,10 @@ class FileDisplayActivity : FileActivity(),
launchCopyFile(data, replace)
}
}

// Refresh the spaces and update the quota
val spacesListViewModel: SpacesListViewModel by viewModel { parametersOf(account.name, false) }
spacesListViewModel.refreshSpacesFromServer()
}

is UIResult.Error -> {
Expand Down

0 comments on commit e16bc95

Please sign in to comment.