Skip to content

Commit

Permalink
inform the developer about failed API initialization due to missing svId
Browse files Browse the repository at this point in the history
  • Loading branch information
warpech committed Oct 21, 2021
1 parent 02fa117 commit ebb5299
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/client-library/clientLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ export const SpreadsheetViewer: SpreadsheetViewer = (options: unknown) => {
// creating the iframe. This ensures that we only handle messages for
// just the iframe that was created during this `SpreadsheetViewer` call.
if (id !== svId) {
if (id?.indexOf('random-') >= -1) {
console.warn(`Spreadsheet Viewer responded with a random 'svId' (${id}) that is different from the 'svId' (${svId}) generated by the client library.
Perhaps the server has removed the 'svId' query string parameter using a redirection?`);
}
return;
}

Expand Down
4 changes: 4 additions & 0 deletions src/sv/components/DeveloperWelcomeScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const DeveloperWelcomeScreen = () => {
<p>
Hello, developer!
</p>
<p>
You have successfully reached the frame assets of Spreadsheet Viewer. However, the integration is
not done, because this document was not initialized by one of the APIs mentioned below.
</p>
<p>
This app is intended to be run:
</p>
Expand Down

0 comments on commit ebb5299

Please sign in to comment.