Fix removing items from file settings

This commit is contained in:
Samuel Elliott 2018-06-22 23:16:42 +01:00
parent a2367299b7
commit 0a2b967e36
No known key found for this signature in database
GPG Key ID: 8420C7CDE43DC4D6
4 changed files with 9 additions and 15 deletions

View File

@ -342,18 +342,10 @@ export default class {
/**
* Wait for content to load
* @param {String} content_id
* @return {Promise}
* @return {Promise => Content}
*/
static waitForContent(content_id) {
return new Promise((resolve, reject) => {
const check = () => {
const content = this.getContentById(content_id);
if (content) return resolve(content);
setTimeout(check, 100);
};
check();
});
return Utils.until(() => this.getContentById(content_id), 100);
}
}

View File

@ -19,6 +19,7 @@
.bd-card-icon {
width: 30px;
height: 30px;
background-size: cover;
}
> span {

View File

@ -61,13 +61,14 @@
.bd-button,
.bd-material-button {
&:first-of-type {
border-radius: 6px 0 0 6px;
border-top-left-radius: 6px;
border-bottom-left-radius: 6px;
}
&:last-of-type {
border-radius: 0 6px 6px 0;
border-top-right-radius: 6px;
border-bottom-right-radius: 6px;
}
&:not(:last-of-type) {

View File

@ -29,7 +29,7 @@
<script>
import { shell } from 'electron';
import { ClientIPC } from 'common';
import { Utils, ClientIPC } from 'common';
import { MiOpenInNew, MiMinus } from '../../common';
import path from 'path';
@ -51,7 +51,7 @@
},
removeItem(file_path) {
if (this.setting.disabled) return;
this.setting = this.setting.value.filter(f => f !== file_path);
Utils.removeFromArray(this.setting.value, file_path);
}
}
}