Skip to content

Commit

Permalink
Revert "fix: deleting inline file should delete file in the list as w…
Browse files Browse the repository at this point in the history
…ell [ch18037]"

This reverts commit 10c9667.
  • Loading branch information
seavan committed Jan 3, 2019
1 parent 10c9667 commit 12a3630
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
11 changes: 1 addition & 10 deletions app/components/files/file-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,7 @@ class FileState extends RoutedState {
}

@action
async deleteFile(fileInfo) {
const id = fileInfo.fileId;
let file = fileStore.getById(id);
if (!file) {
file = await fileStore.loadKegByFileId(id);
if (!file) {
console.error(`could not resolve a file ${id}`);
return Promise.resolve();
}
}
async deleteFile(file) {
const isOwner = file.owner === User.current.username;
const title = isOwner ? tx('dialog_confirmDeleteFile') : tx('title_confirmRemoveFile');
let subtitle = '';
Expand Down
7 changes: 1 addition & 6 deletions app/components/files/file-upload-action-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ import ActionSheetLayout from '../layout/action-sheet-layout';

async function doUpload(sourceFunction, inline) {
const uploader = inline ? fileState.uploadInline : fileState.uploadInFiles;
const uploadInfo = await sourceFunction();
if (!uploadInfo) {
console.log(`no upload info provided. skipping upload`);
return;
}
const source = observable(uploadInfo);
const source = observable(await sourceFunction());
if (inline) {
const userSelection = await FileSharePreview.popup(source.url, source.fileName);
if (!userSelection) return;
Expand Down
4 changes: 0 additions & 4 deletions app/components/helpers/imagepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ async function processResponse(functor, params?) {
if (!response.path && response.uri) {
response.path = response.uri;
}
if (!response.path) {
console.log(`user cancelled image selection. no path returned`);
return null;
}
// if it's a HEIF or HEIC file, it would still give you path to JPG asset
// for the sake of compatibility
const ext = fileHelpers
Expand Down

0 comments on commit 12a3630

Please sign in to comment.