disable sw cache on localhost:8080, chat msg author onclick

This commit is contained in:
Martti Malmi 2022-09-21 13:43:56 +03:00
parent bf0187821f
commit a1ea8d3262
4 changed files with 8 additions and 8 deletions

View File

@ -7,6 +7,7 @@ import Autolinker from 'autolinker';
import iris from '../iris-lib';
import $ from 'jquery';
import State from '../State';
import {route} from 'preact-router';
const autolinker = new Autolinker({ stripPrefix: false, stripTrailingSlash: false});
const ANIMATE_DURATION = 200;
@ -60,9 +61,8 @@ class Message extends Component {
return {seen, delivered};
}
onNameClick(name) {
$('.new-msg').val(`${$('.new-msg').val().trim() } @${name} `);
$('.new-msg').focus();
onNameClick() {
route('/chat/' + this.props.from);
}
openAttachmentsGallery(event) {
@ -167,7 +167,7 @@ class Message extends Component {
<div class="msg ${whose} ${seen} ${delivered}">
<div class="msg-content">
<div class="msg-sender">
${name && this.props.showName && html`<small onclick=${() => this.onNameClick(name)} class="msgSenderName" style="color: ${color}">${name}</small>`}
${name && this.props.showName && html`<small onclick=${() => this.onNameClick()} class="msgSenderName" style="color: ${color}">${name}</small>`}
</div>
${this.props.torrentId ? html`
<${Torrent} torrentId=${this.props.torrentId}/>

View File

@ -125,7 +125,7 @@ export default class PrivateChat extends Component {
});
}
setSortedParticipants() {
setSortedParticipants = _.debounce(() => {
let noLongerParticipant = true;
const sortedParticipants = Object.keys(this.participants)
.filter(k => {
@ -150,7 +150,7 @@ export default class PrivateChat extends Component {
return 0;
});
this.setState({sortedParticipants, noLongerParticipant});
}
}, 1000)
componentDidUpdate() {
if (this.state.stickToBottom) {

View File

@ -22,7 +22,7 @@ export default class BlockedSettings extends Component {
<h3>{t('blocked_users')}</h3>
{blockedUsers.map(user => {
if (this.state.blockedUsers[user]) {
return (<p><a href={`/profile/${ encodeURIComponent(user)}`} ><Text user={user} path="profile/name" placeholder="User" /></a></p>);
return (<p key={user}><a href={`/profile/${ encodeURIComponent(user)}`} ><Text user={user} path="profile/name" placeholder="User" /></a></p>);
}
}
)

View File

@ -21,7 +21,7 @@ registerRoute(
new NetworkOnly()
);
registerRoute(
() => true,
() => location.host !== 'localhost:8080',
new StaleWhileRevalidate()
);
setupRouting();