This commit is contained in:
2024-05-14 03:30:42 +02:00
parent c91ca959f6
commit 3f1a396975
10 changed files with 161 additions and 35 deletions

View File

@ -2,6 +2,7 @@ import {Client} from './Client.js';
import {createNotification} from '../utils/noticeUtils.js'
import { lastView } from '../index.js';
import ProfilePageView from '../views/ProfilePageView.js';
import Search from '../views/Search.js';
export default class Notice {
@ -22,7 +23,7 @@ export default class Notice {
this._socket.onclose = _ => this._socket = undefined;
this._socket.onmessage = message => {
const data = JSON.parse(message.data);
console.log(data)
//console.log(data)
if (data.type === 'friend_request') {
this.friend_request(data.author);
@ -52,6 +53,9 @@ export default class Notice {
lastView.profile.online = status;
lastView.loadFriendshipStatus();
}
else if (lastView instanceof Search) {
lastView.display_specific_user(user.id);
}
}
online(user) {