Skip to content

Commit 1fbeb9f

Browse files
authored
Merge pull request oxen-io#2538 from Bilb/fix-ui-issues
fix: selected message box shadow and hide button while loading DB
2 parents ea35399 + 460cbce commit 1fbeb9f

File tree

6 files changed

+22
-24
lines changed

6 files changed

+22
-24
lines changed

stylesheets/_session_conversation.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
.selection-mode {
9898
.messages-container > *:not(.message-selected) {
9999
animation: toShadow var(--default-duration);
100-
opacity: 0.4;
100+
opacity: 0.3;
101101
}
102102
}
103103
}

ts/components/SessionPasswordPrompt.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,12 +172,15 @@ class SessionPasswordPromptInner extends React.PureComponent<{}, State> {
172172
/>
173173
</>
174174
)}
175-
<SessionButton
176-
text={showResetElements ? window.i18n('tryAgain') : window.i18n('done')}
177-
buttonType={SessionButtonType.BrandOutline} // TODO: theming update
178-
buttonColor={SessionButtonColor.White}
179-
onClick={this.initLogin}
180-
/>
175+
{!this.state.loading && (
176+
<SessionButton
177+
text={showResetElements ? window.i18n('tryAgain') : window.i18n('done')}
178+
buttonType={SessionButtonType.BrandOutline} // TODO: theming update
179+
buttonColor={SessionButtonColor.White}
180+
onClick={this.initLogin}
181+
disabled={this.state.loading}
182+
/>
183+
)}
181184
</div>
182185
);
183186
}

ts/components/conversation/message/message-item/GenericReadableMessage.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,6 @@ const StyledReadableMessage = styled(ReadableMessage)<{
125125
`
126126
background-color: var(--color-compose-view-button-background);
127127
`}
128-
129-
${props =>
130-
props.selected &&
131-
`
132-
&.message-selected {
133-
.module-message {
134-
&__container {
135-
box-shadow: var(--color-session-shadow);
136-
}
137-
}
138-
}
139-
`}
140128
`;
141129

142130
export const GenericReadableMessage = (props: Props) => {

ts/mains/main_node.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ async function showPasswordWindow() {
585585
}
586586

587587
let aboutWindow: BrowserWindow | null;
588+
// tslint:disable-next-line: max-func-body-length
588589
async function showAbout() {
589590
if (aboutWindow) {
590591
aboutWindow.show();
@@ -624,9 +625,11 @@ async function showAbout() {
624625
aboutWindow = null;
625626
});
626627

627-
aboutWindow.once('ready-to-show', () => {
628-
aboutWindow?.show();
629-
});
628+
// looks like sometimes ready-to-show is not fired by electron.
629+
// the fix mentioned here does not work neither: https://github.com/electron/electron/issues/7779.
630+
// But, just showing the aboutWindow right away works correctly, so just force it to be shown when just created.
631+
// It might take half a second to render it's content though.
632+
aboutWindow?.show();
630633
}
631634

632635
let debugLogWindow: BrowserWindow | null = null;
@@ -675,8 +678,10 @@ async function showDebugLogWindow() {
675678

676679
debugLogWindow.once('ready-to-show', () => {
677680
debugLogWindow?.setBackgroundColor('#000');
678-
debugLogWindow?.show();
679681
});
682+
683+
// see above: looks like sometimes ready-to-show is not fired by electron
684+
debugLogWindow?.show();
680685
}
681686

682687
async function saveDebugLog(_event: any, logText: any) {

ts/test/types/Settings_test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { assert } from 'chai';
44

55
import * as Settings from '../../../ts/types/Settings';
66

7+
// tslint:disable-next-line: max-func-body-length
78
describe('Settings', () => {
89
describe('isAudioNotificationSupported', () => {
910
context('on macOS', () => {
@@ -61,7 +62,7 @@ describe('Settings', () => {
6162
Sinon.restore();
6263
});
6364

64-
it('should return false', () => {
65+
it('should return true', () => {
6566
assert.isFalse(Settings.isAudioNotificationSupported());
6667
});
6768
});

ts/util/notifications.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function clearByMessageId(messageId: string) {
109109
}
110110
}
111111

112+
// tslint:disable-next-line: cyclomatic-complexity
112113
function update(forceRefresh = false) {
113114
if (lastNotificationDisplayed) {
114115
lastNotificationDisplayed.close();

0 commit comments

Comments
 (0)