mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-12 02:09:12 +08:00
fix on getByname
This commit is contained in:
parent
a75bef9791
commit
1e13484c26
@ -424,8 +424,8 @@ export default class Connection {
|
||||
}
|
||||
}
|
||||
|
||||
getRemember(): any {
|
||||
return this._options["remember"];
|
||||
getRemember(): Boolean {
|
||||
return this._options["remember"] || false;
|
||||
}
|
||||
|
||||
setRemember(v: Boolean) {
|
||||
@ -568,7 +568,7 @@ export default class Connection {
|
||||
}
|
||||
|
||||
getImageQuality() {
|
||||
return this.getOption("image-quality");
|
||||
return this.getOption('image-quality');
|
||||
}
|
||||
|
||||
getImageQualityEnum(
|
||||
|
@ -229,14 +229,18 @@ window.setByName = (name, value) => {
|
||||
}
|
||||
|
||||
window.getByName = (name, arg) => {
|
||||
try {
|
||||
arg = JSON.parse(arg);
|
||||
} catch (e) { }
|
||||
let v = _getByName(name, arg);
|
||||
if (typeof v == 'string' || v instanceof String) return v;
|
||||
if (v == undefined || v == null) return '';
|
||||
return JSON.stringify(v);
|
||||
}
|
||||
|
||||
function _getByName(name, arg) {
|
||||
switch (name) {
|
||||
case 'peers':
|
||||
return localStorage.getItem('peers') || '[]';
|
||||
case 'remote_id':
|
||||
return localStorage.getItem('remote-id') || '';
|
||||
return localStorage.getItem('remote-id');
|
||||
case 'remember':
|
||||
return curConn.getRemember();
|
||||
case 'event':
|
||||
@ -247,7 +251,7 @@ window.getByName = (name, arg) => {
|
||||
}
|
||||
break;
|
||||
case 'toggle_option':
|
||||
return curConn.getOption(arg);
|
||||
return curConn.getOption(arg) || false;
|
||||
case 'option':
|
||||
return localStorage.getItem(arg);
|
||||
case 'image_quality':
|
||||
|
Loading…
Reference in New Issue
Block a user