3dw / auto20-next

auto20-next
https://we.alearn.org.tw/
MIT License
4 stars 1 forks source link

功能許願:notifications( 初步完成,但是小紅點的計數有問題,一直是0,待檢修) #152

Closed bestian closed 1 month ago

bestian commented 2 months ago

說明:在自己參與的社團若有新建的資源或留言時,可以收到notification,就不必每次登入時主動點入社團去檢查

切豆腐:

leechiuhui commented 2 months ago

@bestian sorry..here comes the question how to updated the firebase Array of Objects from image1 to image 2

截圖 2024-07-26 下午5 49 36 截圖 2024-07-26 下午5 49 52

Thanks,teacher.(sweat smile)

leechiuhui commented 2 months ago

or can the Array of Objects could be like this (as the image)?

截圖 2024-07-26 下午6 13 48

Thanks,teacher.

bestian commented 2 months ago

@bestian sorry..here comes the question how to updated the firebase Array of Objects from image1 to image 2 截圖 2024-07-26 下午5 49 36 截圖 2024-07-26 下午5 49 52 Thanks,teacher.(sweat smile)

$uid 代表使用者的uid.

可以用set的方法

像是諸如 set(usersRef, '/' + this.uid + '/notifications/' + n, obj).then(() => { console.log('notification created')})

之類的

leechiuhui commented 2 months ago

進度更新: 暫時更新setupGroupListeners()但尚未解決onChildAdded不適當觸發以及舊資料觸發,需研究一下snapshot的運作。

截圖 2024-07-27 下午6 08 04

Will fight again on Tuesday, 7/30. Your suggestions are welcome!XD

bestian commented 2 months ago

在邏輯上,onChildAdded 好像在使用者在線才會觸發 是不是可以改成在Group.view的addChat函式去主動發送通知?

bestian commented 2 months ago

我寫了相關的psudocode在Group.view裡,請參考

leechiuhui commented 2 months ago

Thank you teacher,will refer on it.Danke schön.

bestian commented 2 months ago

初步完成,但是小紅點的計數有問題,一直是0,待檢修

bestian commented 2 months ago

我猜想用watcher來監聽uid,確保uid有值時就get一次notifications,應該就可以解決了?

leechiuhui commented 1 month ago

目前測試:

  1. bug1:新建留言時,firebase該社團的member並不會被add新的Notification.---->後來知道了:原來是不會發notification給留言的本人,而會給其他member

  2. bug2:更新社團簡介時,產生很多空的社團Member如下圖:--->目前初步了解,新進入的member,選擇「我要加入社團」時沒有資料

    截圖 2024-08-23 下午4 43 39

    抓到的資料如下圖

    截圖 2024-08-23 下午5 52 37

    新加入的成員,在friendsView.vue中的連結如下圖 undefined 而不是如舊user可以有UID https://we.alearn.org.tw/#/flag/undifiend

    截圖 2024-08-23 下午6 12 45

但是位址卻有顯示UID,如下圖

截圖 2024-08-23 晚上7 22 15
bestian commented 1 month ago

@leechiuhui 這是因為Profile.vue的updateFlag函式有問題,先嘗試修正程式碼了,但時間不足以測試。 麻煩有空用localhost測試(新建帳號 & 更新旗幟)確認修好後,deploy後,再close這個bug issue,非常感謝~