mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-06-02 22:09:20 -05:00
Disable timestamps for past log sent from server
The past log sent from the server when joining a room does not contain information about when the messages were sent, so we do not show a timestamp for those messages.
This commit is contained in:
parent
b6a9c9d3d0
commit
310d8a806b
12
js/sim.js
12
js/sim.js
|
|
@ -261,9 +261,14 @@ function BattleRoom(id, elem) {
|
|||
}
|
||||
selfR.battle.play();
|
||||
if (data.battlelog) {
|
||||
// Disable timestamps for the past log because the server does
|
||||
// not tell us what time the messages were sent at.
|
||||
var timestamps = prefs.timestamps;
|
||||
prefs.timestamps = 'off';
|
||||
for (var i = 0; i < data.battlelog.length; i++) {
|
||||
selfR.battle.add(data.battlelog[i]);
|
||||
}
|
||||
prefs.timestamps = timestamps;
|
||||
selfR.battle.fastForwardTo(-1);
|
||||
}
|
||||
selfR.updateMe();
|
||||
|
|
@ -1562,7 +1567,12 @@ function Lobby(id, elem) {
|
|||
data.log = data.log.splice(data.log.length - 100);
|
||||
}
|
||||
}
|
||||
selfR.add(data.log);
|
||||
// Disable timestamps for the past log because the server doesn't
|
||||
// tell us what time the messages were sent at.
|
||||
var timestamps = prefs.timestamps;
|
||||
prefs.timestamps = 'off';
|
||||
selfR.add(data.log); // Add past log.
|
||||
prefs.timestamps = timestamps;
|
||||
}
|
||||
selfR.update(data);
|
||||
selfR.chatFrameElem.scrollTop(selfR.chatElem.height());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user