mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 13:38:45 +00:00
error message for sharepoint search, and minor style fix
This commit is contained in:
@@ -75,10 +75,10 @@ const Navbar = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center space-x-1">
|
<div className="flex items-center space-x-1">
|
||||||
<div className="px-2 py-1 rounded-lg bg-gray-100 dark:bg-gray-700 font-medium text-xs">
|
<div className="px-2 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 font-medium text-xs">
|
||||||
{os === 'mac' ? '⌘' : 'Ctrl'}
|
{os === 'mac' ? '⌘' : 'Ctrl'}
|
||||||
</div>
|
</div>
|
||||||
<div className="px-2 py-1 rounded-lg bg-gray-100 dark:bg-gray-700 font-medium text-xs">K</div>
|
<div className="px-2 py-1 rounded-lg bg-gray-200 dark:bg-gray-700 font-medium text-xs">K</div>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,14 @@ function useDriveItemSearch() {
|
|||||||
|
|
||||||
// Map parentReference to the absolute path of the search result
|
// Map parentReference to the absolute path of the search result
|
||||||
data.map(item => {
|
data.map(item => {
|
||||||
item['path'] = `${mapAbsolutePath(item.parentReference.path)}/${encodeURIComponent(item.name)}`
|
// TODO: supporting sharepoint search where the path is not returned in parentReference
|
||||||
|
if ('path' in item.parentReference) {
|
||||||
|
item['path'] = `${mapAbsolutePath(item.parentReference.path)}/${encodeURIComponent(item.name)}`
|
||||||
|
} else {
|
||||||
|
throw Error(
|
||||||
|
'We currently only support search in OneDrive international. SharePoint instances are not supported yet. See issue: https://github.com/spencerwooo/onedrive-vercel-index/issues/299'
|
||||||
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default function OAuthStep2() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<p className="py-1">The authorisation code extracted is:</p>
|
<p className="py-1">The authorisation code extracted is:</p>
|
||||||
<p className="my-2 font-mono border border-gray-400/20 rounded text-sm bg-gray-50 dark:bg-gray-800 p-2 opacity-80">
|
<p className="my-2 font-mono border border-gray-400/20 rounded text-sm bg-gray-50 dark:bg-gray-800 p-2 opacity-80 truncate overflow-hidden">
|
||||||
{authCode || <span className="animate-pulse">Waiting for code...</span>}
|
{authCode || <span className="animate-pulse">Waiting for code...</span>}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user