diff --git a/public/popup.css b/public/popup.css index c5702003..23a44add 100644 --- a/public/popup.css +++ b/public/popup.css @@ -343,6 +343,16 @@ background-color: #f2e4b7; } +/* +* Port Video Sections +*/ +.port-video-section { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + /* * Submit box */ diff --git a/src/content.ts b/src/content.ts index a2b106f1..c6fd11b5 100644 --- a/src/content.ts +++ b/src/content.ts @@ -396,7 +396,7 @@ function messageListener( submitPortVideo(request.ytbID); break; case "votePortVideo": - portVideoVote(request.UUID, request.bvid, request.vote); + portVideoVote(request.UUID, request.vote); break; case "updatePortedSegments": updateSegments(request.UUID); @@ -1290,9 +1290,9 @@ async function submitPortVideo(ytbID: VideoID): Promise { return newPortVideo; } -async function portVideoVote(UUID: string, bvID: VideoID, voteType: number) { - await postPortVideoVote(UUID, bvID, voteType); - await getPortVideo(this.bvID, true); +async function portVideoVote(UUID: string, voteType: number) { + await postPortVideoVote(UUID, getVideoID(), voteType); + await getPortVideo(getVideoID(), true); } async function updateSegments(UUID: string): Promise { diff --git a/src/popup/PortVideoSection.tsx b/src/popup/PortVideoSection.tsx index 8459fdf9..24f2937e 100644 --- a/src/popup/PortVideoSection.tsx +++ b/src/popup/PortVideoSection.tsx @@ -85,28 +85,28 @@ export class PortVideoSection extends React.Component + } delay={100} spinning={this.state.loading}> {this.state.show && ( - } delay={100} spinning={this.state.loading}> +
{this.hasPortVideo() ? ( <> {chrome.i18n.getMessage("hasbindedPortVideo")} {this.state.portVideo.ytbID} this.vote(1)} > this.vote(0)} > this.updatePortedSegments()} @@ -124,9 +124,9 @@ export class PortVideoSection extends React.Component )} - +
)} - +
); } } diff --git a/src/render/DesciptionPortPill.tsx b/src/render/DesciptionPortPill.tsx index 500b4ff3..999b2229 100644 --- a/src/render/DesciptionPortPill.tsx +++ b/src/render/DesciptionPortPill.tsx @@ -20,7 +20,7 @@ export class DescriptionPortPill { hasDescription: boolean; getPortVideo: (videoId: VideoID, bypassCache?: boolean) => void; submitPortVideo: (ytbID: VideoID) => Promise; - portVideoVote: (UUID: string, bvID: VideoID, voteType: number) => void; + portVideoVote: (UUID: string, voteType: number) => void; updateSegments: (UUID: string) => Promise; sponsorsLookup: (keepOldSubmissions: boolean, ignoreServerCache: boolean, forceUpdatePreviewBar: boolean) => void; @@ -33,7 +33,7 @@ export class DescriptionPortPill { constructor( getPortVideo: (videoId: VideoID, bypassCache?: boolean) => void, submitPortVideo: (ytbID: VideoID) => Promise, - portVideoVote: (UUID: string, bvID: VideoID, voteType: number) => void, + portVideoVote: (UUID: string, voteType: number) => void, updateSegments: (UUID: string) => Promise, sponsorsLookup: () => void ) { @@ -182,7 +182,7 @@ export class DescriptionPortPill { return; } - this.portVideoVote(this.portUUID, this.bvID, voteType); + this.portVideoVote(this.portUUID, voteType); } private async updateSegmentHandler() {