mirror of
https://github.com/mirego/accent.git
synced 2024-09-19 14:47:29 +03:00
Fix document path parsing in frontend and sync type on new sync
This commit is contained in:
parent
3d83985b32
commit
6621db4a15
@ -114,8 +114,11 @@ export default Component.extend({
|
||||
|
||||
fileChange(files) {
|
||||
const fileSource = files[0];
|
||||
const documentPath = fileSource.name;
|
||||
const documentFormat = this._formatFromExtension(documentPath.split('.').pop());
|
||||
const filename = fileSource.name.split('.');
|
||||
const fileExtension = filename.pop();
|
||||
|
||||
const documentPath = filename.join('.');
|
||||
const documentFormat = this._formatFromExtension(fileExtension);
|
||||
const isFileReading = true;
|
||||
const isFileRead = false;
|
||||
const reader = new FileReader();
|
||||
|
@ -27,7 +27,7 @@ export default Controller.extend({
|
||||
this.set('revisionOperations', null);
|
||||
},
|
||||
|
||||
peek({fileSource, documentFormat, documentPath, revision}) {
|
||||
peek({fileSource, documentFormat, documentPath, revision, syncType}) {
|
||||
const file = fileSource;
|
||||
const project = this.project;
|
||||
const revisions = this.revisions;
|
||||
@ -39,17 +39,18 @@ export default Controller.extend({
|
||||
revisions,
|
||||
file,
|
||||
documentPath,
|
||||
documentFormat
|
||||
documentFormat,
|
||||
syncType
|
||||
})
|
||||
.then(revisionOperations => this.set('revisionOperations', revisionOperations));
|
||||
},
|
||||
|
||||
sync({fileSource, documentFormat, documentPath, revision}) {
|
||||
sync({fileSource, documentFormat, documentPath, revision, syncType}) {
|
||||
const file = fileSource;
|
||||
const project = this.project;
|
||||
|
||||
return this.syncer
|
||||
.sync({project, revision, file, documentPath, documentFormat})
|
||||
.sync({project, revision, file, documentPath, documentFormat, syncType})
|
||||
.then(() => this.flashMessages.success(this.i18n.t(FLASH_MESSAGE_CREATE_SUCCESS)))
|
||||
.then(() => this.send('closeModal'))
|
||||
.catch(() => this.flashMessages.error(this.i18n.t(FLASH_MESSAGE_CREATE_ERROR)));
|
||||
|
Loading…
Reference in New Issue
Block a user