File size: 514 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { PREVIEW_URL_CLEAR, PREVIEW_URL_SET } from 'calypso/state/action-types';
import { setLayoutFocus } from 'calypso/state/ui/layout-focus/actions';

import 'calypso/state/ui/init';

export function setPreviewUrl( url, siteId ) {
	return {
		type: PREVIEW_URL_SET,
		url,
		siteId,
	};
}

export function clearPreviewUrl() {
	return {
		type: PREVIEW_URL_CLEAR,
	};
}

export function closePreview() {
	return ( dispatch ) => {
		dispatch( clearPreviewUrl() );
		dispatch( setLayoutFocus( 'content' ) );
	};
}