File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -42,3 +42,8 @@ export const extractTrackingData = async function (t) {
4242 description : stripStoryPointsAndTaskToken ( card . name ) ,
4343 } ;
4444} ;
45+
46+ export const extractTokenName = async function ( t ) {
47+ const board = await t . board ( "idOrganization" ) ;
48+ return [ "togglToken" , board . idOrganization ] . join ( "_" ) ;
49+ } ;
Original file line number Diff line number Diff line change 1+ import { extractTokenName } from "./extract.js" ;
2+
13const t = TrelloPowerUp . iframe ( ) ;
24
3- window . trektorSettings . addEventListener ( "submit" , function ( event ) {
5+ window . trektorSettings . addEventListener ( "submit" , ( event ) => {
46 event . preventDefault ( ) ;
5- return t . storeSecret ( "togglToken" , window . togglToken . value ) . then ( ( ) => {
6- t . closePopup ( ) ;
7+
8+ return extractTokenName ( t ) . then ( ( tokenName ) => {
9+ t . storeSecret ( tokenName , window . togglToken . value ) . then ( ( ) => {
10+ t . closePopup ( ) ;
11+ } ) ;
712 } ) ;
813} ) ;
914
10- t . render ( function ( ) {
15+ t . render ( ( ) => {
1116 t . sizeTo ( document . body ) . done ( ) ;
1217} ) ;
Original file line number Diff line number Diff line change 11import { TogglGateway , TogglService } from "./toggl.js" ;
2- import { extractTrackingData } from "./extract.js" ;
2+ import { extractTokenName , extractTrackingData } from "./extract.js" ;
33
44const withErrorMessage = async function ( t , fnc ) {
55 try {
@@ -15,7 +15,7 @@ const setTrackingData = async function (t, tracking) {
1515} ;
1616
1717const track = async function ( t ) {
18- const token = await t . loadSecret ( "togglToken" ) ;
18+ const token = await t . loadSecret ( await extractTokenName ( t ) ) ;
1919 if ( token === null ) {
2020 throw new Error ( "Toggl API Token not configured" ) ;
2121 }
You can’t perform that action at this time.
0 commit comments