Skip to content

Commit

Permalink
Merge pull request #42 from arch-org/architec-issue-40
Browse files Browse the repository at this point in the history
Architec issue 40
  • Loading branch information
architec authored Nov 7, 2021
2 parents 6517812 + e6096b7 commit 65d4c8f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Binary file modified screenshots/popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/wrong_anwser_button_update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions src/pages/Content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import { isToday, isPast } from './../../helper';
printLine('Content Script loaded');

const timeValue = setInterval(function () {
var nodeList = document.querySelectorAll('[data-cy="submit-wrong-result"]');
var nodeList = document.querySelectorAll('[data-cy="question-detail-main-tabs"]');
if (nodeList.length > 0) {
var button = document.createElement('button');
button.innerHTML = 'Re-do in 3 days';
button.innerHTML = 'Re-do';
button.id = 'redoButton';
button.type = 'button';
nodeList[0].appendChild(button);
button.style.height = '40px';
button.style.width = '80px';
nodeList[0].children[0].appendChild(button);
clearInterval(timeValue);

var theButton = document.getElementById('redoButton');
Expand All @@ -25,8 +27,6 @@ const timeValue = setInterval(function () {

theButton.addEventListener('click', function () {
chrome.storage.sync.get('data', function (items) {
printLine('items');
console.log(items);
let redos;
if (Object.keys(items).length === 0) {
printLine('items is empty');
Expand All @@ -51,4 +51,4 @@ const timeValue = setInterval(function () {
});
});
}
}, 3000);
}, 1000);
5 changes: 4 additions & 1 deletion src/pages/Popup/Popup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ class Popup extends Component {

render() {
const itemsList = this.state.data.map((redo) => {
let displayTitle = redo.uri.slice(0, -13);
const redoURI = redo.uri;
const spliceStart = redoURI.indexOf('problems/') + 'problems/'.length;
const spliceEnd = redoURI.indexOf('/', spliceStart);
let displayTitle = redo.uri.slice(spliceStart, spliceEnd);
const lastSlash = displayTitle.lastIndexOf('/');
displayTitle = displayTitle.slice(lastSlash + 1);
const today = new Date().toISOString();
Expand Down

0 comments on commit 65d4c8f

Please sign in to comment.