Fix removing items from file settings
This commit is contained in:
parent
a2367299b7
commit
0a2b967e36
|
@ -342,18 +342,10 @@ export default class {
|
||||||
/**
|
/**
|
||||||
* Wait for content to load
|
* Wait for content to load
|
||||||
* @param {String} content_id
|
* @param {String} content_id
|
||||||
* @return {Promise}
|
* @return {Promise => Content}
|
||||||
*/
|
*/
|
||||||
static waitForContent(content_id) {
|
static waitForContent(content_id) {
|
||||||
return new Promise((resolve, reject) => {
|
return Utils.until(() => this.getContentById(content_id), 100);
|
||||||
const check = () => {
|
|
||||||
const content = this.getContentById(content_id);
|
|
||||||
if (content) return resolve(content);
|
|
||||||
|
|
||||||
setTimeout(check, 100);
|
|
||||||
};
|
|
||||||
check();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
.bd-card-icon {
|
.bd-card-icon {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
> span {
|
> span {
|
||||||
|
|
|
@ -61,13 +61,14 @@
|
||||||
|
|
||||||
.bd-button,
|
.bd-button,
|
||||||
.bd-material-button {
|
.bd-material-button {
|
||||||
|
|
||||||
&:first-of-type {
|
&:first-of-type {
|
||||||
border-radius: 6px 0 0 6px;
|
border-top-left-radius: 6px;
|
||||||
|
border-bottom-left-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
border-radius: 0 6px 6px 0;
|
border-top-right-radius: 6px;
|
||||||
|
border-bottom-right-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not(:last-of-type) {
|
&:not(:last-of-type) {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { shell } from 'electron';
|
import { shell } from 'electron';
|
||||||
import { ClientIPC } from 'common';
|
import { Utils, ClientIPC } from 'common';
|
||||||
import { MiOpenInNew, MiMinus } from '../../common';
|
import { MiOpenInNew, MiMinus } from '../../common';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
},
|
},
|
||||||
removeItem(file_path) {
|
removeItem(file_path) {
|
||||||
if (this.setting.disabled) return;
|
if (this.setting.disabled) return;
|
||||||
this.setting = this.setting.value.filter(f => f !== file_path);
|
Utils.removeFromArray(this.setting.value, file_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue