Skip to content

Fix-1994 : Files keep loading when previewing all files in OneDrive #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 13, 2025

Conversation

NishkalankBezawada
Copy link
Contributor

@NishkalankBezawada NishkalankBezawada commented May 22, 2025

Q A
Bug fix? [x]
New feature? [ ]
New sample? [ ]
Related issues? fixes #1994

What's in this Pull Request?

Fix for the issue Files keep loading when previewing all files in OneDrive as mentioned in #1994

Issue

While using FilePicker control, When switching to the OneDrive tab in the FilePicker, it shows a loading spinner indefinitely and never displays the files. All other tabs in the FilePicker — such as Recent, Site, and Upload — work as expected and load properly.

Solution

(Root cause analysis was already done by the issue reporter)
The title of the documents library will vary if the system language is different other than English. For instance, The document library Title in English is as Documents where-in, in swedish it is Dokument.

By checking the default language as below,

  public isCurrentLanguageDefault(): boolean {
    return this.context.pageContext.cultureInfo.currentUICultureName === 'en-US';
  }

and having a conditional check as below,

      const isDefaultLang = this.isCurrentLanguageDefault();
      const myDocumentsLibrary = oneDriveLibsData.value[0];
      this.oneDrivePersonalLibraryTitle = isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName;
      this.oneDriveRootFolderRelativeUrl = `${myDocumentsLibrary.ParentWebUrl}/${isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName}`;
      this.oneDriveRootFolderAbsoluteUrl = `${this.oneDrivePersonalUrl}${isDefaultLang ? myDocumentsLibrary.Title : myDocumentsLibrary.EntityTypeName}`;

Resolves the issue.

Thanks,
Nish

@NishkalankBezawada NishkalankBezawada marked this pull request as ready for review May 22, 2025 17:52
@joaojmendes joaojmendes self-assigned this Jul 13, 2025
@joaojmendes joaojmendes added the status:fixed-next-drop Issue will be fixed in upcoming release. label Jul 13, 2025
@joaojmendes joaojmendes added this to the 3.22.0 milestone Jul 13, 2025
@joaojmendes
Copy link
Collaborator

@NishkalankBezawada Thank you for your fix.

@joaojmendes joaojmendes merged commit 7454dc6 into pnp:dev Jul 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:fixed-next-drop Issue will be fixed in upcoming release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants