Skip to content

Commit

Permalink
Merge pull request #1244 from nextcloud-libraries/refactor/use-unique…
Browse files Browse the repository at this point in the history
…-name-files

refactor: Use `getUniqueName` from `@nextcloud/files`
  • Loading branch information
Pytal authored Jun 20, 2024
2 parents f3c1cfa + d25b9d1 commit 2e23828
Show file tree
Hide file tree
Showing 5 changed files with 249 additions and 353 deletions.
2 changes: 1 addition & 1 deletion lib/components/ConflictPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ import type { ConflictResolutionResult } from '../index.ts'
import { defineComponent } from 'vue'
import { showError } from '@nextcloud/dialogs'
import { getUniqueName } from '@nextcloud/files'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'
import Close from 'vue-material-design-icons/Close.vue'
Expand All @@ -111,7 +112,6 @@ import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import { isFileSystemEntry } from '../utils/filesystem.ts'
import { getUniqueName } from '../utils/uniqueName.ts'
import { n, t } from '../utils/l10n.ts'
import logger from '../utils/logger.ts'
import NodesPicker from './NodesPicker.vue'
Expand Down
5 changes: 2 additions & 3 deletions lib/components/UploadPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ import type { Upload } from '../upload.ts'
import type { Directory } from '../utils/fileTree'
import { DialogBuilder, showWarning } from '@nextcloud/dialogs'
import { getNewFileMenuEntries, Folder, NewMenuEntryCategory } from '@nextcloud/files'
import { Folder, NewMenuEntryCategory, getNewFileMenuEntries, getUniqueName } from '@nextcloud/files'
import makeEta from 'simple-eta'
import Vue from 'vue'
Expand All @@ -150,7 +150,6 @@ import IconUpload from 'vue-material-design-icons/Upload.vue'
import { getUploader, openConflictPicker, getConflicts } from '../index.ts'
import { Status } from '../uploader.ts'
import { Status as UploadStatus } from '../upload.ts'
import { getUniqueName } from '../utils/uniqueName'
import { t } from '../utils/l10n.ts'
import logger from '../utils/logger.ts'
import PCancelable from 'p-cancelable'
Expand Down Expand Up @@ -368,7 +367,7 @@ export default Vue.extend({
*
* @param filename The invalid file name
*/
async showInvalidFileNameDialog(filename: string) {
async showInvalidFileNameDialog(filename: string): Promise<boolean> {
return new PCancelable(async (resolve, reject) => {
await new DialogBuilder()
.setName(t('Invalid file name'))
Expand Down
19 changes: 0 additions & 19 deletions lib/utils/uniqueName.ts

This file was deleted.

Loading

0 comments on commit 2e23828

Please sign in to comment.