Skip to content
Snippets Groups Projects
Commit 4ff6bcde authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Simplify close_sub()

Should be no functional change.
parent b17ff339
No related branches found
No related tags found
No related merge requests found
...@@ -1594,27 +1594,19 @@ function save_cfg() ...@@ -1594,27 +1594,19 @@ function save_cfg()
function close_sub() function close_sub()
{ {
var code;
if(base != undefined && base.is_open) { if(base != undefined && base.is_open) {
msg_ptrs[base.subnum]=scan_ptr; msg_ptrs[base.subnum]=scan_ptr;
code = get_base_code(base);
lock_cfg(); lock_cfg();
try { try {
if(base.subnum==-1) { read_cfg(get_base_code(base), false);
read_cfg('mail', false); if (saved_config[code].scan_ptr!=scan_ptr) {
if (saved_config.mail.scan_ptr!=scan_ptr) { saved_config[code].scan_ptr=scan_ptr;
saved_config.mail.scan_ptr=scan_ptr;
save_cfg();
}
}
else {
if (base.cfg != undefined) {
read_cfg(base.cfg.code, false);
if (saved_config[base.cfg.code].scan_ptr !== scan_ptr) {
saved_config[base.cfg.code].scan_ptr=scan_ptr;
save_cfg(); save_cfg();
} }
} }
}
}
catch (error) { catch (error) {
unlock_cfg(); unlock_cfg();
throw error; throw error;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment