mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 06:39:48 +00:00
use fromSync true to indicate pasting from url should refresh the ui (#5195)
This commit is contained in:
parent
d28d8cafb6
commit
b3c3c9b594
@ -113,7 +113,6 @@ export const RequestPane: FC<Props> = ({
|
||||
const gitVersion = useGitVCSVersion();
|
||||
const activeRequestSyncVersion = useActiveRequestSyncVCSVersion();
|
||||
const activeEnvironment = useSelector(selectActiveEnvironment);
|
||||
// const activeResponse = useSelector(selectActiveResponse);
|
||||
const activeRequestMeta = useSelector(selectActiveRequestMeta);
|
||||
// Force re-render when we switch requests, the environment gets modified, or the (Git|Sync)VCS version changes
|
||||
const uniqueKey = `${activeEnvironment?.modified}::${request?._id}::${gitVersion}::${activeRequestSyncVersion}::${activeRequestMeta?.activeResponseId}`;
|
||||
|
@ -13,9 +13,9 @@ import {
|
||||
ACTIVITY_UNIT_TEST,
|
||||
AUTOBIND_CFG,
|
||||
} from '../../common/constants';
|
||||
import { database } from '../../common/database';
|
||||
import { importRaw } from '../../common/import';
|
||||
import { initializeSpectral, isLintError } from '../../common/spectral';
|
||||
import * as requestOperations from '../../models/helpers/request-operations';
|
||||
import * as models from '../../models/index';
|
||||
import {
|
||||
isRequest,
|
||||
@ -147,16 +147,19 @@ export class WrapperClass extends PureComponent<Props, State> {
|
||||
|
||||
if (r && r._type === 'request' && activeRequest && isRequest(activeRequest)) {
|
||||
// Only pull fields that we want to update
|
||||
return requestOperations.update(activeRequest, {
|
||||
return database.update({
|
||||
...activeRequest,
|
||||
modified: Date.now(),
|
||||
url: r.url,
|
||||
method: r.method,
|
||||
headers: r.headers,
|
||||
// @ts-expect-error -- TSCONVERSION
|
||||
body: r.body,
|
||||
authentication: r.authentication,
|
||||
// @ts-expect-error -- TSCONVERSION
|
||||
parameters: r.parameters,
|
||||
});
|
||||
},
|
||||
// Pass true to indicate that this is an import
|
||||
true
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
// Import failed, that's alright
|
||||
|
Loading…
Reference in New Issue
Block a user