Skip to content

Commit b35681e

Browse files
committed
(breaking) change last_changed to camelCase
1 parent 0e57d5a commit b35681e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ rooms="[
398398
avatar: 'assets/imgs/doe.png',
399399
status: {
400400
state: 'online',
401-
last_changed: 'today, 14:30'
401+
lastChanged: 'today, 14:30'
402402
}
403403
},
404404
{
@@ -407,7 +407,7 @@ rooms="[
407407
avatar: 'assets/imgs/snow.png',
408408
status: {
409409
state: 'offline',
410-
last_changed: '14 July, 20:00'
410+
lastChanged: '14 July, 20:00'
411411
}
412412
}
413413
],
@@ -419,10 +419,10 @@ rooms="[
419419
- If you add the `index` property, your rooms will be ordered using this value.
420420
`index` can be any sortable value, like a `string`, `datetime`, `timestamp`, etc.
421421

422-
- For each room user, you can add the `status` property, which can hold the `state` and `last_changed` properties:
422+
- For each room user, you can add the `status` property, which can hold the `state` and `lastChanged` properties:
423423

424424
- `state` can be `'online'` or `'offline'`
425-
- `last_changed` is the date when `state` was last modified.
425+
- `lastChanged` is the date when `state` was last modified.
426426

427427
- `typingUsers` is an array of all the users who are currently writing a message
428428

demo/src/ChatContainer.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,12 +641,12 @@ export default {
641641
642642
const isOfflineData = {
643643
state: 'offline',
644-
last_changed: firebase.database.ServerValue.TIMESTAMP
644+
lastChanged: firebase.database.ServerValue.TIMESTAMP
645645
}
646646
647647
const isOnlineData = {
648648
state: 'online',
649-
last_changed: firebase.database.ServerValue.TIMESTAMP
649+
lastChanged: firebase.database.ServerValue.TIMESTAMP
650650
}
651651
652652
firebase
@@ -673,12 +673,12 @@ export default {
673673
.on('value', snapshot => {
674674
if (!snapshot || !snapshot.val()) return
675675
676-
const last_changed = this.formatTimestamp(
677-
new Date(snapshot.val().last_changed),
678-
new Date(snapshot.val().last_changed)
676+
const lastChanged = this.formatTimestamp(
677+
new Date(snapshot.val().lastChanged),
678+
new Date(snapshot.val().lastChanged)
679679
)
680680
681-
user.status = { ...snapshot.val(), last_changed }
681+
user.status = { ...snapshot.val(), lastChanged }
682682
683683
const roomIndex = this.rooms.findIndex(
684684
r => room.roomId === r.roomId

src/ChatWindow/Room/RoomHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ export default {
121121
122122
if (user.status.state === 'online') {
123123
text = this.textMessages.IS_ONLINE
124-
} else if (user.status.last_changed) {
125-
text = this.textMessages.LAST_SEEN + user.status.last_changed
124+
} else if (user.status.lastChanged) {
125+
text = this.textMessages.LAST_SEEN + user.status.lastChanged
126126
}
127127
128128
return text

0 commit comments

Comments
 (0)