Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 4051551

Browse files
Merge pull request #1368 from ssbc/block-options-fix
Fix Options drop-down in profile view.
2 parents 57ccce8 + 481bf50 commit 4051551

File tree

1 file changed

+38
-39
lines changed

1 file changed

+38
-39
lines changed

lib/depject/contact/html/follow-toggle.js

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -94,45 +94,44 @@ exports.create = function (api) {
9494
? ignoring
9595
: status === false
9696

97-
electron.remote.getCurrentWindow().webContents.getZoomFactor((factor) => {
98-
const menu = electron.remote.Menu.buildFromTemplate([
99-
{
100-
type: 'radio',
101-
label: i18n('Neutral'),
102-
checked: status == null,
103-
click: () => setStatus(id, null, { states, ignores })
104-
},
105-
{
106-
type: 'radio',
107-
label: i18n('Follow'),
108-
checked: status === true,
109-
click: () => setStatus(id, true, { states, ignores })
110-
},
111-
{
112-
type: 'radio',
113-
label: i18n('Block'),
114-
checked: status === false,
115-
click: () => setStatus(id, false, { states, ignores })
116-
},
117-
{ type: 'separator' },
118-
{
119-
type: 'radio',
120-
label: i18n('Listen'),
121-
checked: !resolvedIgnoring,
122-
click: () => setIgnore(id, false, { states, ignores })
123-
},
124-
{
125-
type: 'radio',
126-
label: i18n('Ignore'),
127-
checked: resolvedIgnoring,
128-
click: () => setIgnore(id, true, { states, ignores })
129-
}
130-
])
131-
menu.popup({
132-
window: electron.remote.getCurrentWindow(),
133-
x: Math.round(rects.left * factor),
134-
y: Math.round(rects.bottom * factor) + 4
135-
})
97+
const factor = electron.remote.getCurrentWindow().webContents.getZoomFactor()
98+
const menu = electron.remote.Menu.buildFromTemplate([
99+
{
100+
type: 'radio',
101+
label: i18n('Neutral'),
102+
checked: status == null,
103+
click: () => setStatus(id, null, { states, ignores })
104+
},
105+
{
106+
type: 'radio',
107+
label: i18n('Follow'),
108+
checked: status === true,
109+
click: () => setStatus(id, true, { states, ignores })
110+
},
111+
{
112+
type: 'radio',
113+
label: i18n('Block'),
114+
checked: status === false,
115+
click: () => setStatus(id, false, { states, ignores })
116+
},
117+
{ type: 'separator' },
118+
{
119+
type: 'radio',
120+
label: i18n('Listen'),
121+
checked: !resolvedIgnoring,
122+
click: () => setIgnore(id, false, { states, ignores })
123+
},
124+
{
125+
type: 'radio',
126+
label: i18n('Ignore'),
127+
checked: resolvedIgnoring,
128+
click: () => setIgnore(id, true, { states, ignores })
129+
}
130+
])
131+
menu.popup({
132+
window: electron.remote.getCurrentWindow(),
133+
x: Math.round(rects.left * factor),
134+
y: Math.round(rects.bottom * factor) + 4
136135
})
137136
}
138137

0 commit comments

Comments
 (0)