Skip to content

Commit

Permalink
Only show urgent and subject in MMS if appropriate
Browse files Browse the repository at this point in the history
Former-commit-id: 0e7b9d5
  • Loading branch information
joaomgcd committed Jul 30, 2020
1 parent 34d6e56 commit 98bf8c0
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion appdashboardhelpernotifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class AppDashboardNotifications extends AppHelperBase{
const {NotificationInfo} = await import("./v2/notification/notificationinfo.js")
this.controlNotifications.notifications = options.map(optionsSingle=>new NotificationInfo(optionsSingle,optionsSingle.device));
await this.controlNotifications.render();
await Util.sleep(500);
await Util.sleep(50);
ServerEventBus.post(new RequestResize(this.controlNotifications.notificationsListSize));
}
async onRequestReplyMessage(request){
Expand Down
1 change: 1 addition & 0 deletions server/servernotification.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class WindowNotifications extends Array{

const request = EventBus.waitFor(RequestNotificationInfo,3000);
this.window = new BrowserWindow(args)
this.window.showInactive();
this.window.loadFile('index.html',{ query: { notificationpopup: true }});
if(debugging){
this.window.webContents.toggleDevTools();
Expand Down
12 changes: 7 additions & 5 deletions v2/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ export class Control extends ExtendableProxy {
return root;
}
//open
async unload(){
await Control.unloadControls(this);
async unload(justSelf){
await Control.unloadControls(this,justSelf);
}
async dispose(){
await this.unload();
async dispose(justSelf){
await this.unload(justSelf);
const parent = this.root.parentElement;
if(!parent) return;

Expand All @@ -192,8 +192,10 @@ export class Control extends ExtendableProxy {
//abstract
getStyle(){}

static async unloadControls(obj){
static async unloadControls(obj,justSelf){
await EventBus.unregister(obj);
if(justSelf) return;

for(const prop in obj){
const value = obj[prop];
// if(Util.isArray(value)){
Expand Down
3 changes: 2 additions & 1 deletion v2/device/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,9 @@ export class Device{
return AppContext.context.localStorage.get(this.canContactLocalNetworkKey);
}
get canContactViaLocalNetwork(){
if(this.socket) return true;
// return false;
if(this.socket) return true;

return this.localNetworkServerAddress ? true : false;
}
set canContactViaLocalNetwork(value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,13 @@ export class ControlNotificationClickHandler extends Control{
const index = this.controlsNotifications.findIndex(criteriaFunc);
if(index < 0) return;

const controlNotification = this.controlsNotifications[index];
this.controlsNotifications.splice(index,1);
await this.render();
if(controlNotification){
await controlNotification.dispose(true);
}else{
await this.render();
}
}
/**
*
Expand Down
10 changes: 7 additions & 3 deletions v2/sms/conversation/controlsmsconveration.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ export class ControlSMSConversation extends Control{
// UtilDOM.hide(this.contactPictureElement);
// }

this.inputElement.placeholder = `Send message to ${this.smsConversation.contact.address}`;

const contact = this.smsConversation.contact;
if(contact){
this.inputElement.placeholder = `Send message to ${contact.address}`;
}
this.listenToEnterKey();
UtilDOM.onclickandlongclick(this.sendButtonElement, async ()=> await this.sendSms(), async () => UtilDOM.toggleShow(this.mmsExtrasElement))

Expand Down Expand Up @@ -201,8 +205,8 @@ export class ControlSMSMessage extends Control{

const isMMS = this.smsMessage.isMMS;
UtilDOM.showOrHide(this.attachmentElement,isMMS);
UtilDOM.showOrHide(this.urgentElement,isMMS);
UtilDOM.showOrHide(this.subjectElement,isMMS);
UtilDOM.showOrHide(this.urgentElement,isMMS && this.smsMessage.urgent);
UtilDOM.showOrHide(this.subjectElement,isMMS && this.smsMessage.subject);
UtilDOM.addOrRemoveClass(this.senderPictureContainerElement,!this.isLastMultiple,"invisible");
UtilDOM.addOrRemoveClass(this.containerElement,this.isLastMultiple && this.multipleReceived,"lastofmultiple");
UtilDOM.addOrRemoveClass(this.containerElement,!this.isLastMultiple && this.multipleReceived,"oneofmultiple");
Expand Down

0 comments on commit 98bf8c0

Please sign in to comment.