Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #246 from tahnik/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
tahnik authored Jan 25, 2018
2 parents ceea27e + af470e9 commit 96cedc1
Show file tree
Hide file tree
Showing 6 changed files with 1,201 additions and 218 deletions.
16 changes: 12 additions & 4 deletions app/src/js/components/user/compact_user_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ class CompactUserCard extends Component {
const profilePicture = new Image();
profilePicture.onload = () => {
window.clearInterval(reload);
this.profilePicture.src = profilePicture.src;
if (this.profilePicture) {
this.profilePicture.src = profilePicture.src;
}
};
profilePicture.src = imgsrc;
if (profilePicture) {
profilePicture.src = imgsrc;
}
}, 1000);
}
componentDidUpdate() {
Expand All @@ -49,9 +53,13 @@ class CompactUserCard extends Component {
}
const profilePicture = new Image();
profilePicture.onload = () => {
this.profilePicture.src = profilePicture.src;
if (this.profilePicture) {
this.profilePicture.src = profilePicture.src;
}
};
profilePicture.src = imgsrc;
if (profilePicture) {
profilePicture.src = imgsrc;
}
}
mouseOut() {
this.setState({ confirm: false });
Expand Down
3 changes: 3 additions & 0 deletions app/src/js/components/utilities/smart_area.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ class SmartArea extends Component {
buildMentions(text, caretPos) {
const lastChar = text.charAt(caretPos - 1);
const { users } = this.props;
if (!users) {
return;
}
if (lastChar === ' ' || lastChar === '') {
active = false;
pos = 0;
Expand Down
30 changes: 27 additions & 3 deletions app/src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const { ipcRenderer } = require('electron');

window.onerror = (msg) => {
console.log(msg);

const reqListener = () => {
console.log(this.responseText);
};
Expand All @@ -22,8 +21,33 @@ window.onerror = (msg) => {
);
oReq.send();

settings.deleteAll();
ipcRenderer.send('reLaunch', true);
const doesExist = document.getElementsByClassName('reset_button')[0];

if (!doesExist) {
const div = document.createElement('div');
div.innerHTML = `
<p>We have hit an error! If the app crashed, please reset the cache</p>
`;
const btn = document.createElement('button');
const t = document.createTextNode('Reset Cache'); // Create a text node
btn.appendChild(t);
btn.onclick = () => {
settings.deleteAll();

ipcRenderer.send('reLaunch', true);
};

div.appendChild(btn);

// better to use CSS though - just set class
div.setAttribute('class', 'reset_button'); // and make sure myclass has some styles in css
document.body.appendChild(div);

setTimeout(() => {
document.body.removeChild(div);
}, 3000);
}


const suppressErrorAlert = true;
// If you return true, then error alerts (like in older versions of
Expand Down
28 changes: 28 additions & 0 deletions app/src/res/sass/modules/common.sass
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,34 @@ $post_comment_height: 13rem
width: 18px !important
margin: 0px 2px -3px 2px

@keyframes reset_btn
0%
opacity: 0
transform: translateY(-10px)
5%
opacity: 1
transform: translateY(0px)
95%
opacity: 1
transform: translateY(0px)
100%
opacity: 0
transform: translateY(-10px)

.reset_button
position: absolute
z-index: 999
display: flex
flex-direction: column
align-items: center
width: 100vw
background-color: rgba(0, 0, 0, 0.8)
color: white
padding-bottom: 5px
animation: reset_btn 3s forwards
p
margin-bottom: 0

.release_info_container
padding: 0 0.5rem 0 2rem
color: white
Expand Down
Loading

0 comments on commit 96cedc1

Please sign in to comment.