Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-nadymov committed Oct 9, 2018
1 parent d41bdfa commit 246d09b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/TelegramApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,17 +191,6 @@ class TelegramApp extends Component{
}
}

onUpdateMessageSendSucceeded(old_message_id, message){
const selectedChatId = ChatStore.getSelectedChatId();
if (selectedChatId !== message.chat_id) return;

let updatedHistory = this.state.history.map((obj) =>{
return obj.id === old_message_id ? message : obj;
});

this.setHistory(updatedHistory);
}

handleSelectChat(chat){
const selectedChatId = ChatStore.getSelectedChatId();
const chatId = chat ? chat.id : 0;
Expand Down
3 changes: 3 additions & 0 deletions src/registerServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ function registerValidSW(swUrl) {
navigator.serviceWorker
.register(swUrl)
.then(registration => {

registration.onupdatefound = () => {
const installingWorker = registration.installing;
installingWorker.onstatechange = () => {
//console.log('[SW] onstatechange state=' + installingWorker.state);

if (installingWorker.state === 'installed') {
if (navigator.serviceWorker.controller) {
// At this point, the old content will have been purged and
Expand Down

0 comments on commit 246d09b

Please sign in to comment.