payload: {"action":"created","issue":{"url":"https://api.github.com/repos/j-000/scratchpad/issues/36","repository_url":"https://api.github.com/repos/j-000/scratchpad","labels_url":"https://api.github.com/repos/j-000/scratchpad/issues/36/labels{/name}","comments_url":"https://api.github.com/repos/j-000/scratchpad/issues/36/comments","events_url":"https://api.github.com/repos/j-000/scratchpad/issues/36/events","html_url":"https://github.com/j-000/scratchpad/issues/36","id":489027452,"node_id":"MDU6SXNzdWU0ODkwMjc0NTI=","number":36,"title":"Minor bugs with Regular Tasks","user":{"login":"j-000","id":43117830,"node_id":"MDQ6VXNlcjQzMTE3ODMw","avatar_url":"https://avatars3.githubusercontent.com/u/43117830?v=4","gravatar_id":"","url":"https://api.github.com/users/j-000","html_url":"https://github.com/j-000","followers_url":"https://api.github.com/users/j-000/followers","following_url":"https://api.github.com/users/j-000/following{/other_user}","gists_url":"https://api.github.com/users/j-000/gists{/gist_id}","starred_url":"https://api.github.com/users/j-000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-000/subscriptions","organizations_url":"https://api.github.com/users/j-000/orgs","repos_url":"https://api.github.com/users/j-000/repos","events_url":"https://api.github.com/users/j-000/events{/privacy}","received_events_url":"https://api.github.com/users/j-000/received_events","type":"User","site_admin":false},"labels":[{"id":1526045312,"node_id":"MDU6TGFiZWwxNTI2MDQ1MzEy","url":"https://api.github.com/repos/j-000/scratchpad/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":1526045318,"node_id":"MDU6TGFiZWwxNTI2MDQ1MzE4","url":"https://api.github.com/repos/j-000/scratchpad/labels/enhancement","name":"enhancement","color":"a2eeef","default":true}],"state":"open","locked":false,"assignee":{"login":"crispinkoech","id":26304286,"node_id":"MDQ6VXNlcjI2MzA0Mjg2","avatar_url":"https://avatars1.githubusercontent.com/u/26304286?v=4","gravatar_id":"","url":"https://api.github.com/users/crispinkoech","html_url":"https://github.com/crispinkoech","followers_url":"https://api.github.com/users/crispinkoech/followers","following_url":"https://api.github.com/users/crispinkoech/following{/other_user}","gists_url":"https://api.github.com/users/crispinkoech/gists{/gist_id}","starred_url":"https://api.github.com/users/crispinkoech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crispinkoech/subscriptions","organizations_url":"https://api.github.com/users/crispinkoech/orgs","repos_url":"https://api.github.com/users/crispinkoech/repos","events_url":"https://api.github.com/users/crispinkoech/events{/privacy}","received_events_url":"https://api.github.com/users/crispinkoech/received_events","type":"User","site_admin":false},"assignees":[{"login":"crispinkoech","id":26304286,"node_id":"MDQ6VXNlcjI2MzA0Mjg2","avatar_url":"https://avatars1.githubusercontent.com/u/26304286?v=4","gravatar_id":"","url":"https://api.github.com/users/crispinkoech","html_url":"https://github.com/crispinkoech","followers_url":"https://api.github.com/users/crispinkoech/followers","following_url":"https://api.github.com/users/crispinkoech/following{/other_user}","gists_url":"https://api.github.com/users/crispinkoech/gists{/gist_id}","starred_url":"https://api.github.com/users/crispinkoech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crispinkoech/subscriptions","organizations_url":"https://api.github.com/users/crispinkoech/orgs","repos_url":"https://api.github.com/users/crispinkoech/repos","events_url":"https://api.github.com/users/crispinkoech/events{/privacy}","received_events_url":"https://api.github.com/users/crispinkoech/received_events","type":"User","site_admin":false},{"login":"j-000","id":43117830,"node_id":"MDQ6VXNlcjQzMTE3ODMw","avatar_url":"https://avatars3.githubusercontent.com/u/43117830?v=4","gravatar_id":"","url":"https://api.github.com/users/j-000","html_url":"https://github.com/j-000","followers_url":"https://api.github.com/users/j-000/followers","following_url":"https://api.github.com/users/j-000/following{/other_user}","gists_url":"https://api.github.com/users/j-000/gists{/gist_id}","starred_url":"https://api.github.com/users/j-000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-000/subscriptions","organizations_url":"https://api.github.com/users/j-000/orgs","repos_url":"https://api.github.com/users/j-000/repos","events_url":"https://api.github.com/users/j-000/events{/privacy}","received_events_url":"https://api.github.com/users/j-000/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2019-09-04T08:51:42Z","updated_at":"2019-09-04T09:50:27Z","closed_at":null,"author_association":"OWNER","body":"@crispinkoech \r\n1)\r\n```\r\n// regularTasks.js\r\nupdate_global_time({ commit }) {\r\n    setInterval(() => {\r\n      commit('UPDATE_GLOBAL_TIME')\r\n    }, 1000)\r\n  }\r\n\r\n// RegularTasksPad.vue\r\ncreated() {\r\n    this.update_global_time();\r\n  }\r\n```\r\n\r\nThe `created()` methods is called everytime the tab \"My Regular Tasks\" is clicked. As a result the mapped action `update_global_time` is called and a new setInterval is generated. This creates multiple setIntervals when only one should be created. But there should not be a setInterval if no tasks exists. Finally, a settings optiong to customise the setInterval would be great (this helps with development as well).\r\n\r\n2) When starting a regular task the clock starts on the `RegularTaskItem`. But if you click on any other tab and come back to the \"My Regular Tasks\" tab the clock is reset. This is probably due to the fact the created method is called again which updates the global time. \r\n\r\nTo tackle these issue it would be best to come to an agreement for requirements.\r\n\r\nUser + App requirements\r\n\r\n- [x] Users set regular tasks and can delete them\r\n- [ ] Users can start and stop the timers in the regular tasks\r\n- [ ] Users can navigate out of the \"Regular Tasks\" tab without affecting the state of the app\r\n- [ ] When using `setInterval` the function needs to be global so that only one is created. Also there should be an option to manually change the interval time\r\n\r\nPlease feel free to add your suggestions. :smile: \r\n"},"comment":{"url":"https://api.github.com/repos/j-000/scratchpad/issues/comments/527829344","html_url":"https://github.com/j-000/scratchpad/issues/36#issuecomment-527829344","issue_url":"https://api.github.com/repos/j-000/scratchpad/issues/36","id":527829344,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNzgyOTM0NA==","user":{"login":"j-000","id":43117830,"node_id":"MDQ6VXNlcjQzMTE3ODMw","avatar_url":"https://avatars3.githubusercontent.com/u/43117830?v=4","gravatar_id":"","url":"https://api.github.com/users/j-000","html_url":"https://github.com/j-000","followers_url":"https://api.github.com/users/j-000/followers","following_url":"https://api.github.com/users/j-000/following{/other_user}","gists_url":"https://api.github.com/users/j-000/gists{/gist_id}","starred_url":"https://api.github.com/users/j-000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-000/subscriptions","organizations_url":"https://api.github.com/users/j-000/orgs","repos_url":"https://api.github.com/users/j-000/repos","events_url":"https://api.github.com/users/j-000/events{/privacy}","received_events_url":"https://api.github.com/users/j-000/received_events","type":"User","site_admin":false},"created_at":"2019-09-04T09:50:27Z","updated_at":"2019-09-04T09:50:27Z","author_association":"OWNER","body":"That's makes sense. A user starts a timer, if the view changes then save that running timer to global state, when the view is created check if a running timer was saved and fetch it but compute the correct remaining time (might need to also save the timestamp of the saved timer to compute the difference between the time it was saved beforeDestroyed and the time it was reinstated). \r\n\r\nHope I make sense :smile: \r\n"}}
other: {"actor":{"display_login":"j-000"}}