"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ts/notifications/getStatus.ts" between
Signal-Desktop-1.35.2.tar.gz and Signal-Desktop-1.36.1.tar.gz

About: Signal-Desktop is a cross-platform encrypted messaging service (also available for mobile devices).

getStatus.ts  (Signal-Desktop-1.35.2):getStatus.ts  (Signal-Desktop-1.36.1)
interface Environment { interface Environment {
isAppFocused: boolean; isAppFocused: boolean;
isAudioNotificationEnabled: boolean; isAudioNotificationEnabled: boolean;
isAudioNotificationSupported: boolean; isAudioNotificationSupported: boolean;
isEnabled: boolean; isEnabled: boolean;
numNotifications: number; hasNotifications: boolean;
userSetting: UserSetting; userSetting: UserSetting;
} }
interface Status { interface Status {
shouldClearNotifications: boolean; shouldClearNotifications: boolean;
shouldPlayNotificationSound: boolean; shouldPlayNotificationSound: boolean;
shouldShowNotifications: boolean; shouldShowNotifications: boolean;
type: Type; type: Type;
} }
skipping to change at line 31 skipping to change at line 31
| 'disabled' | 'disabled'
| 'appIsFocused' | 'appIsFocused'
| 'noNotifications' | 'noNotifications'
| 'userSetting'; | 'userSetting';
export const getStatus = ({ export const getStatus = ({
isAppFocused, isAppFocused,
isAudioNotificationEnabled, isAudioNotificationEnabled,
isAudioNotificationSupported, isAudioNotificationSupported,
isEnabled, isEnabled,
numNotifications, hasNotifications,
userSetting, userSetting,
}: Environment): Status => { }: Environment): Status => {
const type = ((): Type => { const type = ((): Type => {
if (!isEnabled) { if (!isEnabled) {
return 'disabled'; return 'disabled';
} }
const hasNotifications = numNotifications > 0;
if (!hasNotifications) { if (!hasNotifications) {
return 'noNotifications'; return 'noNotifications';
} }
if (isAppFocused) { if (isAppFocused) {
return 'appIsFocused'; return 'appIsFocused';
} }
if (userSetting === 'off') { if (userSetting === 'off') {
return 'userSetting'; return 'userSetting';
 End of changes. 3 change blocks. 
3 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)