Answer the question
In order to leave comments, you need to log in
How to set different icons for multiple running instances of the same application?
System: arch with openbox and tint2.
Situation following:
Several vncview are started. How to set its own icon for each instance, so as not to get confused later.
Answer the question
In order to leave comments, you need to log in
As one of the options, make symlinks to the binary, create several .desktop files in which you specify different symlinks and icons for them.
The pg.any function is asynchronous and, as a result res[0].error = errors;
, is executed before processing unique logins. To work correctly, you need to postpone the work with errors until all queries to the database are executed:
User.prototype.join = function (user, res) {
var errors = [],
unique = [];
for (var i = 0; i < user.length; i++) {
if (user[i].required && !user[i].value) {
errors.push('Вы не ввели логин');
}
if (user[i].unique) {
var query = pg.any('SELECT id FROM users WHERE login=$1', [user[i].value]).then(function (user) {
if (user.length) {
errors.push('Пользователь с таким логином уже зарегистрирован');
}
});
unique.push(query);
}
}
return Promise.all(unique).then(function () {
res[0].error = errors;
});
};
// неправильно
join(user, res);
// дальнейшая обработка res
// правильно
join(user, res).then(function () {
// дальнейшая обработка res
});
(function (i) { ... })(i);
in the original version is meaningless, so I removed it. And if (user[i].unique == true) {
identical if (user[i].unique) {
. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question