Set the default image name to be the original file name, and move all of the strings into the localization file (closes #10)
This commit is contained in:
parent
3a8a2092f7
commit
e98584d648
5 changed files with 18 additions and 12 deletions
|
|
@ -48,7 +48,7 @@ export class ImageApp extends
|
|||
|
||||
// #region Instance Data
|
||||
/** The artist that is being edited, or the default artist values */
|
||||
_doc = { path: ``, tags: [], artists: [] };
|
||||
_doc = { name: ``, path: ``, tags: [], artists: [] };
|
||||
|
||||
get title() {
|
||||
if (this._docID) {
|
||||
|
|
@ -88,7 +88,6 @@ export class ImageApp extends
|
|||
// Validate the DB hasn't been updated since opening
|
||||
if (!(await this.isAbleToSave())) { return };
|
||||
|
||||
|
||||
// Upload new image to server
|
||||
if (!this._docID) {
|
||||
const hash = this._doc.hash;
|
||||
|
|
@ -148,7 +147,7 @@ export class ImageApp extends
|
|||
this.#artistCache.push({ value: id, label: artist.name });
|
||||
};
|
||||
};
|
||||
|
||||
console.log(this._doc);
|
||||
const ctx = {
|
||||
meta: {
|
||||
idp: this.id,
|
||||
|
|
@ -179,7 +178,7 @@ export class ImageApp extends
|
|||
if (!file) {
|
||||
this.#file = null;
|
||||
this._docID = null;
|
||||
this._doc = { path: ``, artists: [], tags: [] };
|
||||
this._doc = { path: ``, name: ``, artists: [], tags: [] };
|
||||
this._updateFrame({ window: { title: this.title } });
|
||||
await this.render({ parts: [`header`, `preview`, `form`] });
|
||||
return;
|
||||
|
|
@ -201,9 +200,10 @@ export class ImageApp extends
|
|||
|
||||
// Temporarily blob the image so it can be displayed in-app
|
||||
const url = URL.createObjectURL(file);
|
||||
this._doc.name = file.name.replace(`.${extension}`, ``);
|
||||
this._doc.path = url;
|
||||
this._doc.hash = hash;
|
||||
await this.render({ parts: [`preview`] });
|
||||
await this.render({ parts: [`preview`, `form`] });
|
||||
};
|
||||
|
||||
/** @this {ImageApp} */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue